주식 자동매매 시스템

파이썬을 이용한 주식 자동매매 시스템

이미지
파이썬을 이용한 주식 자동매매 시스템 INDEX 환경구축 키움증권 API - 연결테스트 키움증권 API - 계좌정보 조회 키움증권 API - 주문 키움증권 API - 종목정보 가져오기 포트폴리오 - 종목, 업종별 자산 포트폴리오 한국투자증권 API API reference 키움 OpenAPI+ 개발가이드 한국투자증권 OpenAPI 다운로드 및 가이드 Design https://www.design-seeds.com/in-nature/succulents/cacti-color-2/ https://create.piktochart.com/dashboard

Linux에 Oracle 설치하기

  • Oracle 설치 파일 다운로드
    • oracle-xe-11.2.0-1.0.x86_64.rpm.zip
    • Window > Linux 다운로드 폴더로 copy
    Oracle Database 11g Release 2

  • zip 파일 압축 풀기
  • 다운로드 파일로 이동 > 다운로드 파일 확인 > 압축풀기
    # cd 다운로드
    # ls -l oracle*
    # unzip oracle*

  • rpm 파일 설치
    • 임시로 가상 메모리 추가
    • Oracle Database Express 11g를 설치하려면 최소 1990MB 이상의 가상 메모리가 필요 임시로 가상 메모리 추가
      1. 가상 메모리용 파일 생성
      2. 파일을 가상 메모리로 포맷
      3. 가상 메모리 활성화
      4. 가상 메모리 용량 확인
      # dd if=/dev/zero of=/swapfile bs=1024 count=4194304
      # mkswap /swapfile
      # swapon /swapfile
      # swapon -s
      결과
      # swapon /swapfile
      swapon: /swapfile: insecure permissions 0644, 0600 suggested.
      # swapon -s
      Filename    Type  Size Used Priority
      /dev/sda1                               partition 2047996 134528 -1
      /swapfile                               file 4194300 0 -2
      
      • rpm 파일 설치
      • # cd Disk1/
        # ls -l oracle*
        # yum -y localinstall oracle*
        
    • 아래와 같이 실패 할 경우
      • swap 용량이 부족해서 발생하는 오류 >> 가상 메모리 추가
      Total size: 564 M
      Installed size: 564 M
      Downloading packages:
      Running transaction check
      Running transaction test
      Transaction test succeeded
      Running transaction
      This system does not meet the minimum requirements for swap space.  Based on
      the amount of physical memory available on the system, Oracle Database 11g
      Express Edition requires 2048 MB of swap space. This system has 1999 MB
      of swap space.  Configure more swap space on the system and retry the 
      installation.
      
      오류: %pre(oracle-xe-11.2.0-1.0.x86_64) scriptlet failed, exit status 1
      Error in PREIN scriptlet in rpm package oracle-xe-11.2.0-1.0.x86_64
        Verifying  : oracle-xe-11.2.0-1.0.x86_64                                  1/1 
      
      Failed:
        oracle-xe.x86_64 0:11.2.0-1.0                                                 
      
      Complete!
      

    • 환경 설정
      • 환경 설정 시작 (둘 중 하나로 가능)
      • # service oracle-xe configure
        # /etc/init.d/oracle-xe configure
      
      [root@master Disk1]# service oracle-xe configure
      
      Oracle Database 11g Express Edition Configuration
      -------------------------------------------------
      This will configure on-boot properties of Oracle Database 11g Express 
      Edition.  The following questions will determine whether the database should 
      be starting upon system boot, the ports it will use, and the passwords that 
      will be used for database accounts.  Press  to accept the defaults. 
      Ctrl-C will abort.
      
      # port number '8080' : connect for oracle web page
      Specify the HTTP port that will be used for Oracle Application Express [8080]:
           > [enter]
      # port number '1521' : connect for SQL*PLUS
      Specify a port that will be used for the database listener [1521]:
           > [enter]
      Specify a password to be used for database accounts.  Note that the same
      password will be used for SYS and SYSTEM.  Oracle recommends the use of 
      different passwords for each database account.  This can be done after 
      initial configuration:
      Password can't be null. Enter password:
      # password 설정 System으로 접속할 때의 비밀번호
      Confirm the password:
      
      Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:y
      
      Starting Oracle Net Listener...Done
      Configuring database...
      Done
      Starting Oracle Database 11g Express Edition instance...Done
      Installation completed successfully.
      
      • 서비스 시작
      • /etc/init.d/oracle-xe 명령은 [start/stop/status] 가 있다
        # /etc/init.d/oracle-xe start
        Starting oracle-xe (via systemctl):                        [  OK  ]
        
      • 오라클 환경을 설정해주는 스크립트 실행
      • # . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
        
      • 재부팅 후에도 적용되도록 설정
      • # vi /etc/bashrc
        # . /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
        

    • 포트 열기

      외부에서 접속할 수 있도록 Oracle이 사용하는 8080, 1521 PORT를 열어준다.

      # firewall-config

    • Web에서 Oracle 접속

      server의 IP주소로 접속 http://192.168.111.101:8080/apex
      • 관리자 계정으로 로그인
        Workspace : internal Username : admin Password : 설치 할 때 지정한 비밀번호

      이 블로그의 인기 게시물

      Linux에서 CSV파일 사용방법

      R에서 외부 데이터 이용하기 (Excel, csv)

      [R 함수] aggregate, apply 사용 방법