0
Follow
0
Followers
def get_records(value):
Log("get records day:",value)
records = exchange.GetRecords(PERIOD_D1)
res = 0
for i in range(-(value + 1),-1):
res = res + records[i]["Close"]
Log("time:", records[i]["Time"], "value:",records[i]["Close"])
return res/value
Cette fonction permet de calculer la moyenne
Dans la rétro-analyse, le cycle de k-lignes du disque dur ne peut pas être réglé sur des jours entiers, donc la longueur des records est généralement de 5, 6 jours seulement, il n'est pas possible d'obtenir une moyenne de 30 jours, comment faire?
Related Recommendations
Advanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?5.5 Trading strategy optimization
