Page 1 of 1

Strategy start at 7AM local time

PostPosted: Tue Feb 13, 2018 12:34 pm
by conjure
Hi.
I m trying to make my own strategy and i want the strategy to check the current state of the last candle at 7 am local time on DAY chart.i Know that source.close( 0 ) is wrong.
How can i do it?
Can someone help me on that?


Code: Select all
source.close( 0 )>source.close( 1 ) .and. source.close( 1 )>source.close( 2 )
.and. source.close( 2 )>source.close( 3 )  .and. source.close( 3 )<source.close( 4 )



Re: Strategy start at 7AM local time

PostPosted: Fri Feb 16, 2018 7:44 am
by Apprentice
--for the current (last) candle use
source.close[ period]
--for the candle before the last use
source.close[ period-1]

--and so on...

--or u can use
--for the current (last) candle use
source.close[ source:size()-1]
--for the candle before the last use
source.close[ source:size()-1-1]

--and so on...


--or u can use
local Last=source:size()-1;
--for the current (last) candle use
source.close[ Last]
--for the candle before the last use
source.close[Last-1]

--and so on...