The resource loading... loading...

Use of exchange.GetAccount (()) in retesting

Author: Feathers on sheep, Created: 2021-03-11 18:28:35, Updated:

I used the following code to retest it. Def Calculate MA ((n, record): sumMA is equal to 0 for i in range ((n): sumMA += record[- ((i+1) ][] return sumMA/n

Def SimpleMAStrategy ((status): This is a list of characters that are in the game. account = exchange.GetAccount GetTicker is the name of the game. record = exchange.GetRecords ((RecordsTime)) MAFast = Calculate MA ((MAFastN, record)) MASlow = Calculate MA (MASlowN, record) Balance = account stocks = account Log (( Current holdings are: , account[Stocks], Current balance is: , account[Balance]) currSell1Price = ticker [Sell button] This is the current value of the ticker. if (MAFast >= MASlow and status == 0): id = exchange.Buy ((-1, balance*rate/ticker[Sell button]) status = 1 if (MAFast <= MASlow and status == 1): id = exchange.Sell ((-1, stocks) status = 0 return the status

status = 0 while(true): status = SimpleMAStrategy(status) Sleep(3000)

It was found that the output of the current holding in the retest is always: 3.89e-07 The current balance is: 1999 9.166986677. Please ask exchange.GetAccount in the retest is it always only return the information set in the configuration parameters?


More

The grassRe-testing requires removing what was added before re-adding takes effect.