previouse candles
As i read the forum i can reach t-1 candle but in my strategy, but i need to access t-2, t-3, t-4 etc. candles 

is it possible to reach t-2, t-3, t-4 etc. candles OHLC values ? from strategy window
I'm not sure if it is built into Gekko, but I just use an array to store previous candles so my strat can use it.
If it isn't crypto, it isn't worth mining, it isn't worth speculating.
I had a wee bit of code that does that, I'm no coder so it's probably not the best way to do it but in my update part I had something like:

Candle5 = Candle4
Candle4 = Candle3
Candle3 = Candle2
Candle2 = Candle.close

Remember to set your required history to however many candles you add.
im not a pro too but,
i learnd about using Arrays and, its so impressive to use it with the "for loop"
As cryptoer49 says thats a good choice!
Its hard to explain, but its so SMART, that it would be truely beneficial to learn about it..!
Gekko TUTORIAL (Array included):
gekko strategie tutorial #2
very nice youtube video TUTORIAL for Arrays:
Cave of Programming

Forum Jump:

Users browsing this thread: