1. 영호 조건식 추가 진행중!!!!!
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
|
||||
using BitgetAPI.Data;
|
||||
using BitgetAPI.Data.IndicatorData;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -14,9 +16,41 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
// 이동 평균선 종류
|
||||
public CommonProperty.MovingAverageType MovingAverageType { get; set; }
|
||||
// 기간
|
||||
public int CandleLegnth { get; set; }
|
||||
public int CandleLegnth24 { get; set; } = 24;
|
||||
// 기간
|
||||
public int CandleLegnth4 { get; set; } = 4;
|
||||
// 기간
|
||||
public int CandleLegnth72 { get; set; } = 72;
|
||||
// 가격
|
||||
public CommonProperty.CandlePriceType MACandlePriceType { get; set; }
|
||||
public CommonProperty.CandlePriceType MACandlePriceType { get; set; }
|
||||
|
||||
// 추후 업데이트 된것을 계산 안하는거 고려 !!!!
|
||||
public void Cal_YHK_Downpublic(List<CandleData> candleDatas, CandleData candleData)
|
||||
{
|
||||
// 현재 종가 인덱스
|
||||
var endIndex = candleDatas.Count() - 1;
|
||||
|
||||
if (candleData == null) return;
|
||||
|
||||
// Moving 없으면 생성
|
||||
if (candleData.movingAverageDataList == null) candleData.movingAverageDataList = new Dictionary<int, MovingAverageData>();
|
||||
|
||||
candleData.movingAverageDataList.Add(CandleLegnth4, new MovingAverageData());
|
||||
candleData.movingAverageDataList.Add(CandleLegnth24, new MovingAverageData());
|
||||
candleData.movingAverageDataList.Add(CandleLegnth72, new MovingAverageData());
|
||||
|
||||
foreach(var item in candleData.movingAverageDataList)
|
||||
{
|
||||
// 전봉까지 만듬
|
||||
var datas = candleDatas.FindAll(i =>
|
||||
candleDatas.IndexOf(i) > endIndex - item.Key &&
|
||||
candleDatas.IndexOf(i) <= endIndex);
|
||||
|
||||
candleData.movingAverageDataList[item.Key] = new MovingAverageData();
|
||||
candleData.movingAverageDataList[item.Key].Value = datas.Sum(i => i.Close);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user