- 5MA 계산 버그 수정

- 매수, 매도 조건 수정 : 5MA slope 조건 추가
- 기본 파라미터 수정
This commit is contained in:
2016-08-01 01:29:48 +09:00
parent b831b56934
commit 62315062bf
8 changed files with 307 additions and 209 deletions

View File

@@ -1,5 +1,4 @@
using MySql.Data.MySqlClient;
using System;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@@ -20,9 +19,9 @@ namespace upper_limit_crawler
public float m_fLossCut;
}
public struct BLACKLIST
public struct POSTPONE_ITEM
{
public BLACKLIST(string strCode, int iTime)
public POSTPONE_ITEM(string strCode, int iTime)
{
m_strCode = strCode;
m_iTime = iTime;
@@ -39,7 +38,9 @@ namespace upper_limit_crawler
ULTrader m_Trader = new ULTrader();
Dictionary<string, ULWatchItem> m_WatchList = new Dictionary<string, ULWatchItem>();
List<BLACKLIST> m_BlackList = new List<BLACKLIST>();
List<POSTPONE_ITEM> m_PostponeList = new List<POSTPONE_ITEM>();
Dictionary<string, int> m_LossCutList = new Dictionary<string, int>();
List<string> m_BlackList = new List<string>();
public ULDataMgr()
{
@@ -109,15 +110,34 @@ namespace upper_limit_crawler
}
}
public void AddBlackList(int iTime, string strCode)
public void AddPostphoneItem(int iTime, string strCode)
{
BLACKLIST black = new BLACKLIST(strCode, iTime);
m_BlackList.Add(black);
POSTPONE_ITEM postpone = new POSTPONE_ITEM(strCode, iTime);
m_PostponeList.Add(postpone);
}
public bool IsInBlackList(int iTime, string strCode)
public bool IsInPostponeList(int iTime, string strCode)
{
return m_BlackList.Any(r => r.m_strCode == strCode && ULUtil.IsInTime(r.m_iTime, iTime, 5));
return m_PostponeList.Any(r => r.m_strCode == strCode && ULUtil.IsInTime(r.m_iTime, iTime, 4));
}
public void AddLosscutItem(string strCode)
{
if(m_LossCutList.ContainsKey(strCode) == false)
{
m_LossCutList.Add(strCode, 1);
}
else
{
m_LossCutList[strCode] += 1;
if(m_LossCutList[strCode] >= 2)
m_BlackList.Add(strCode);
}
}
public bool IsInBlackList(string strCode)
{
return m_BlackList.Any(r => r == strCode);
}
public Dictionary<string, ULWatchItem> GetWatchList()