How to program this in the Condition block?
-
I would like my condition to be:
"If yesterday's close is higher than the close on year earlier, buy."
I can get yesterdays close by choosing "Candles Close" parameter but I'm not sure how to find last years candle close. Can anyone point me in some direction?
Thanks
-
how exactly you mean "one year back"? ...
is it Close from previous year (last Close in 2016) ....
or is it Close 365 days back? -
@miro1360 Close from 365 days back. Thanks.
-
tried you this?

-
365 candles does not mean 365 days before, because 2 candles per week are missing because of Saturday and Sunday, and who knows how many other candles because of bad quality of the chart. If you do that, make sure that everything is fine with the data and that 1 year candle can be found on the chart. Or you can also try with Weekly or Monthly.
-
right, sorry my bad
... it are fewer candles ... but logic still the same ...

-
@miro1360 said in How to program this in the Condition block?:
but logic still the same
It would actually be 251 candles including holidays :). Thanks @miro1360