주식 자동매매 시스템

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

이미지
파이썬을 이용한 주식 자동매매 시스템 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

영어공부하기 좋은 사이트

https://breakingnewsenglish.com/ http://www.manythings.org/ https://www.coursera.org/?authMode=signup https://youtu.be/kzEsyJYkLHY Please complete the following grammar quiz about conjunctions. Please remember to check your score!!!!!!! https://www.myenglishpages.com/site_php_files/grammar-exercise-conjunctions-and-but-or.php

R에서 통계분석 데이터 이용하기 (foreign package)

R에서 통계분석 데이터 이용하기  foreign 패키지 SPSS, SAS, STATA 등 통계분석 소프트웨어의 파일을 불러오기 위해서 'foreign' 패키지를 이용한다. install.packages('foreign') library(foreign)      # SPSS 파일 불러오기 library(dplyr)        # 전처리 library(ggplot2)    # 시각화 library(readxl)      # 엑셀 파일 불러오기 # SPSS 파일을 Dataframe으로 가져온다 raw_welfare <- read.spss(file = 'Koweps_hpc10_2015_beta1.sav', to.data.frame = T) # 복사본을 만든다 welfare <- raw_welfare # colume에 대한 정보 분석 str(welfare) # colume 명 변경 welfare <- rename(welfare,                   sex = h10_g3,                   birth = h10_g4,                   marriage = h10_g10,                   religion = h10_g11,                   income = p1002_8aq1,                   code_job = h10_eco9,                   code_region = h10_reg7                   ) # 성별 항목 이름 부여 sex : 1 -> male 2 -> female > welfare$sex <- ifelse(welfare$sex == 1, 'male', 'female') > table(welfare$sex) ## female male ## 9086 7578 qplot(welfare$sex

[R 함수] sqldf 사용 방법

이미지
How to use 'sqldf' function sqldf 는 R에서 sql 문법을 사용할 수 있도록 해주는 package이다. 1. Libarary load library(ggplot2) library(sqldf) mpg 데이터를 사용하기 위해 ggplot2 라이브러리를 로드한다. sqldf 함수를 사용하기 위해 sqldf 라이브러리를 로드한다. mympg <- sqldf('SELECT *, (cty+hwy)/2 AS total FROM mpg') mympg2 <- sqldf('SELECT total,                 CASE                 WHEN total > 20                 THEN "PASS"                 ELSE "FAIL"                 END AS "total2"                 FROM mympg') mympg2 <- sqldf('SELECT total,                 CASE                 WHEN total > 20                 THEN "PASS"                 ELSE "FAIL"                 END AS "total2"                 FROM mympg') mympg3 <- sqldf('SELECT total,                 CASE                 WHEN total > 30                 THEN "A"                 WHEN total > 20                 THEN "B&q

make와 Makefile

이미지
make란 make는 Program을 유지하는데 필요한 Utility이다. make 유틸리티는 프로그램이 커져서 파일들이 분리되어 있을 때, 어떤 파일들이 다시 컴파일 되어야 하는지 결정하고 컴파일하는 명령들을 자동으로 실행해준다. 프로그램 개발자는 make가 자동으로 컴파일하고 관리할 수 있도록 'Makefile'을 작성해야 한다.  make 는 cmd 창에서 make 명령을 실행하면 된다. 쉘 명령으로 실행 가능한 컴파일러는 make를 사용할 수 있다. GNU make는 파일명이 'GNUmakefile, Makefile, makefile'로 되어있으면 make가 찾아서 실행할 수 있다. 일반적으로는 'Makefile'을 추천한다. 어떤 파일을 어떻게 컴파일 할지 제어하기 위해서는 make 명령에 parameter들을 사용하면 된다. Makefile 'Makefile'은 make가 이해할 수 있도록 쉘 스크립트 언어처럼 되어 있다. Makefile에는 결과 파일 생성을 위해서 프로그램안에 있는 파일들간의 관계, 파일을 컴파일하는 명령어 등을 기술해줘야 한다. make의 필요성 프로그램 개발 시 여러 개의 파일로 나누어 개발을 하게되면, 파일들이 서로 관계를 갖고 있기 때문에 어떤 파일을 변경하면 그걸 이용하는 다른 파일도 새로 컴파일 되어야 한다. 이렇게 컴파일이 필요한 것과 아닌 것을 관리해준다는 장점이 있다. <ex> 아래 예제를 보면, write.c, read.c 파일이 io.h 파일을 include하고 있다. 컴파일을 하면 test.exe가 생성된다. 그 후 io.h 파일에 수정사항이 있을 경우, 모든 파일을 재컴파일 할 필요가 없다. io.h 파일과 의존관계에 있는 파일들만 재컴파일 하면 변경이 적용된 test.exe 가 생성된다.      Makefile 기본 작성법 Targets : Dependencies..

[C] printf format %

The % Format Specifiers %c char single character %d (%i) int signed integer %e (%E) float or double exponential format %f float or double signed decimal %g (%G) float or double use %f or %e as required %o int unsigned octal value %p pointer address stored in pointer %s array of char sequence of characters %u int unsigned decimal %x (%X) int unsigned hex value Internally what matters is the bits arrangement not the statements. unsigned int ui = 0xffffffff; printf("%d", ui); // -1 printf("%u", ui); // 4294967295 When you say to the 'printf' "%u" you're saying: "interpret my word as a unsigned bit arrangement", and in the other side, when you say "%d" you're saying "interpret my word as a signed bit arrangement". %u를 쓰면 ui 변수의 bit array를 unsigned int로 해석하고 출력 %d를 쓰면 ui 변수의 bit array를 signed int 처럼 해석하고 출력한다. int si = 0xffffffff; printf("%d",

[Refactoring] C++ 리팩토링

C++ 리팩토링 Extract Method 하나의 그룹으로 묶어 분리할 수 있는 코드를 뽑아낸다. 코드가 작게 분리 될 수록 하위 클래스가 작은 메소드를 override하기 쉽다. 큰 메소드 하나는 하위 클래스가 전체 메소드를 재정의해야 함으로 작업량이 많아진다 void Owing::printOwing (double amount) { printBanner (); cout << "name : " << _name << endl; cout << "amount : " << amount << endl; } void Owing::printOwing (double amount) { printBanner (); printDetail(amount); } void Owing::printDetail(double amount) { cout << "name : " << _name << endl; cout << "amount : " << amount << endl; } Extract Function 코드 블록을 전역 함수 로 분리 멤버 변수를 액세스 하는 코드 블록은 적용할 수 없다 Inline Method Extract Method의 반대로 메소드가 하는 일이 명확하고 작을 때 메소드 호출을 삭제하고 코드를 붙여 넣는다. 리팩토링을 역행하므로 특별한 경우가 아니면 사용할 필요가 없다. 위음을 통해 메소드가 서로 연결된 경우 이것을 단순화 시키기 위해 사용할 수 있다. Inline Temp - Inline Constant 간단한 수식의 결과를 가지는 임시변수를 Inline Temp로 정의 명칭만으로 명확한 함수 호출이 단순히 임시변수에 대입 되어 사용되는 경우 임시 변수를 제거하고 함수 호출을 바로 하는 방법 임시 변수의 제

git-bash로 source 관리하기

이미지
git-bash 설치 git으로 관리할 프로젝트 폴더 안에서 git-bash를 실행한다. # git 저장소 생성 # 관리 할 프로젝트의 workspace를 repository로 선언 $ git init # 변경된 사항을 stage에 올린다 $ git add # stage에 올라간 변경사항을 commit $ git commit # 원격 저장소에 ... $ git push # 현재 상태 확인 $ git status git add .  현재 폴더 + 하위 폴더, 파일을 한번에 stage에 추가하겠다 git commit  > vi editor가 뜸 message 작성하라고 git commit -m ""  commit message 등록 git remote add origin https://github.com/fksdud456/TIL.git git push -u origin master 다른 remote가 설정되어 있는 경우, clone 해온 경우 $ git remote rm origin $ git remote add ....

[GitHub Pages] Git을 이용한 web page 배포

이미지
github에서 repository를 생성한다 Repository의 이름은  사용자ID .github.io 로 생성해야 한다.  본인의 ID를 정확하게 써줘야하는 것이 GitHub Page를 생성하는 규칙이므로 스펠링도 틀리면 안된다. 만들어둔 웹 프로젝트를 repository에 push한다  $ git remote add origin https://github.com/fksdud456/fksdud456.github.io.git $ git push -u origin master 웹페이지 접속 접속 URL : https:// 사용자id .github.io/ index.html이 main 페이지이기 때문에 꼭 index.html 파일이 있어야한다. Web page 참고

참고할만한 기술블로그

이미지
spoqa 기술블로그 우아한형제들 기술블로그 Kakao 기술블로그

[Android] Tablayout에서 Fragment로 Google Map 사용방법

Tablayout > 3개의 Fragment를 Tab을 누를 때마다 이동하게 만든다 먼저 MainActivity에서는 Tablayout와 ViewPager를 통해 3개의 Fragment가 생성될 수 있도록 한다. MainActivity / activity_main.xml  activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <android.support.design.widget.TabLayout android:id="@+id/tablayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ffffff" app:tabGravity="fill" app:tabIndicatorColor="@color/colorIndicator" app:tabMode="fixed" app:tabSelectedTextColor="@col