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
Calculate a straight line with this function In retesting, the k-line cycle of the disk cannot be set to a full day, so the length of the records is often only 5, 6 days, and the 30-day average line cannot be obtained.