- 시뮬레이션 파라미터 조정
- 실제 매도에 적용
This commit is contained in:
@@ -27,10 +27,41 @@ namespace AutoSellerNS
|
||||
|
||||
public int m_iTrailingCount = 0;
|
||||
|
||||
public List<int> m_PriceList = new List<int>();
|
||||
public double m_dCheckCount = 5;
|
||||
|
||||
double m_dFastSD = 0.75;
|
||||
double m_dFastUpCnt = 0.05;
|
||||
double m_dFastDownCnt = 0.05;
|
||||
double m_dSlowSD = 0.2;
|
||||
double m_dSlowUpCnt = 0.4;
|
||||
double m_dSlowDownCnt = 0.4;
|
||||
|
||||
public void OnRecievedPrice()
|
||||
{
|
||||
bool bReal = (m_StockCur.GetHeaderValue(19) == '2');
|
||||
m_iCurPrice = m_StockCur.GetHeaderValue(13);
|
||||
|
||||
m_PriceList.Add(m_iCurPrice);
|
||||
double dAverage = (float)m_PriceList.Average();
|
||||
double sumOfSquaresOfDifferences = m_PriceList.Select(val => Math.Pow((val-dAverage)/m_CybosHelper.GetUnitValue(val), 2)).Sum();
|
||||
double dStdDev = Math.Sqrt(sumOfSquaresOfDifferences / m_PriceList.Count);
|
||||
if(dStdDev >= m_dFastSD)
|
||||
{
|
||||
if(m_iCurPrice >= dAverage)
|
||||
m_dCheckCount += m_dFastUpCnt;
|
||||
else
|
||||
m_dCheckCount -= m_dFastDownCnt;
|
||||
|
||||
}
|
||||
else if(dStdDev <= m_dSlowSD)
|
||||
{
|
||||
if(m_iCurPrice >= dAverage)
|
||||
m_dCheckCount += m_dSlowUpCnt;
|
||||
else
|
||||
m_dCheckCount -= m_dSlowDownCnt;
|
||||
}
|
||||
|
||||
if(m_iCurPrice > m_iMaxPrice)
|
||||
m_iTrailingCount = 0;
|
||||
|
||||
@@ -46,7 +77,7 @@ namespace AutoSellerNS
|
||||
m_iCheckCount = 0;
|
||||
}
|
||||
|
||||
if(m_iCheckCount >= Config.GetBidCount() && m_Listener.IsSelling() == true)
|
||||
if(m_iCheckCount >= m_dCheckCount && m_Listener.IsSelling() == true)
|
||||
{
|
||||
m_CybosHelper.SellItem(m_strCode, m_Listener.GetSellableCount(m_strCode), m_aiAskPrice[0]);
|
||||
Util.Log(Util.LOG_TYPE.SELL, string.Format("[조건 완료 매도] {0} ({1}회) (현재가 {2:n0}원, 최고가 {3:n0}원)", m_strCodeName, Config.GetBidCount(), m_iCurPrice, m_iMaxPrice));
|
||||
|
||||
Reference in New Issue
Block a user