value return from indicator .last(1) . last(0) on nest value is not the same
value return from indicator .last(1) . last(0) on nest value is not the same
06 Mar 2016, 03:36
Hy i needs some help to understand how that work. in my robot i get information of in bar data of :
Print("getbackcheckbuy{0} , {1} ", STOCHMICB.Result.Last(1), STOCHMICB.Result.Last(0));
for example : real data is at 9:00 oclok 25.00
9:30 oclok 30.00
10:00 oclok 40.00
but the information i got from the print is : at 9:00 = 8:30 value() , 24.56
at 9:30 = 25.00 , 30.25
at 9:30 = 30.00 , 40.5
Why is not the same value from the last(0) , last (1) for the nest value
Replies
cedric.boudreau
06 Mar 2016, 18:15
tanks , that will , help me.
It is hard to double check, because the indicator show a cross in graph , but in robot, i use last(0) so the trigger value are différent
If i use :
STOCHMICB.Result.Last(2), STOCHMICB.Result.Last(1));
THe trigger will be very late , how to manage that, to be in same time frame ,
with the open value will be good , how to get it / i need to creta a indicator using open value
@cedric.boudreau
cyfer
07 Mar 2016, 00:03
A Cross is only considered a Cross after the Bar Closes not before
A Cross can happen before the candle closes and then retreats and becomes a Touch not a Cross .
You can't count on a momentary Cross .. You'll get too many false signals
make your Calculations in OnBar() method , So it will happen on the beginning of each new bar , and yes you should test Bar(2)&Bar(1)
Bar(0) Doesn't exist till it Closes
**********************************
Even if your indicator is working on 1M TimeFrame & your Bot is working on 5M or higher , you'll still test Bar(2)&Bar(1) but then you should put the calculations
in OnTick() method
@cyfer
cyfer
06 Mar 2016, 05:02
With such little code , it's impossible to tell
However , You should be aware that Last(0) represents the Current Bar , I.e .. It didn't finish yet .. so with each tick you'll have different values
the only value you can count on before the bar closes is the Open Value .. the other 3 values may change completely in 1 tick .
@cyfer