Gekko Forum
previouse candles - Printable Version

+- Gekko Forum (https://forum.gekko.wizb.it)
+-- Forum: Gekko (https://forum.gekko.wizb.it/forum-13.html)
+--- Forum: General Discussion (https://forum.gekko.wizb.it/forum-14.html)
+--- Thread: previouse candles (/thread-57145.html)



previouse candles - onefifthmine - 05-11-2018

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


RE: previouse candles - crypto49er - 05-11-2018

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.


RE: previouse candles - Ballsy - 05-12-2018

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.


RE: previouse candles - susitronix - 05-12-2018

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