This commit is contained in:
dsyoon
2021-09-04 13:42:51 +09:00
parent 4cdcb62dcf
commit 5ef4aca07c
2 changed files with 10 additions and 4 deletions

View File

@@ -511,7 +511,7 @@ class Analyzer:
isbuy = 1
# 위치에너지 < 0.4 and 볼린저밴드 < 0.3 이어야 한다.
if positionalEnergy < 0.3 or bolingerband_score < 0.3:
if positionalEnergy < 0.2 or bolingerband_score < 0.2:
isbuy = 2
# 볼린저밴드 하단에 부딪힌 후 2개의 양봉을 보였으면, 매수한다.

View File

@@ -2,6 +2,7 @@ from bs4 import BeautifulSoup
from pandas import DataFrame, Series
import requests as re
import pandas as pd
import os
import json
import sqlite3
import requests
@@ -10,8 +11,8 @@ class FnGuideCrawler:
header = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'}
def getStockInfo(self):
#code_df = pd.read_html('http://kind.krx.co.kr/corpgeneral/corpList.do?method=download&searchType=13', header=0)[0]
code_df = pd.read_html(requests.get('http://kind.krx.co.kr/corpgeneral/corpList.do?method=download&searchType=13', headers=self.header).text)
code_df = pd.read_html('http://kind.krx.co.kr/corpgeneral/corpList.do?method=download&searchType=13', header=0)[0]
#code_df = pd.read_html(requests.get('http://kind.krx.co.kr/corpgeneral/corpList.do?method=download&searchType=13', headers=self.header).text)
# 종목코드가 6자리이기 때문에 6자리를 맞춰주기 위해 설정해줌
code_df.종목코드 = code_df.종목코드.map('{:06d}'.format)
@@ -120,4 +121,9 @@ class FnGuideCrawler:
if __name__ == "__main__":
crawler = FnGuideCrawler()
crawler.get_fnguide_table('155660')
#crawler.get_fnguide_table('155660')
PROJECT_HOME = os.path.join(os.path.dirname(os.path.join(os.path.dirname(os.path.join(os.path.dirname(os.path.join(os.path.dirname(__file__))))))))
inFnguideFileName = PROJECT_HOME + '/resources/fnguide.db'
crawler = FnGuideCrawler()
crawler.crawl_fnguide(inFnguideFileName)