I am using 2 Time frame: data1 with 1min, data2 240min.
On data1 run the following script in real time.
Data1 is update correclty on every 1min when bar is close. This is ok!
On Data2, Close of data 2 (CL2 ) remain always the same, because the bar is not changhed yet.
I would to like to update the price of data2 with the effective real time value when the script evaluate the 1min bar (on data1)
I tried to use intrabarpersis in the declaration of the CL1, CL2 but same result.
Is it possible to do this?
Note. This code is used in a signal.
Any help will be appreciated.
Thank you
Code: Select all
Variables:
intrabarpersist Cl1(0),
intrabarpersist Cl2(0);
once cleardebug;
if (BarStatus(1) = 2) and (LastBarOnChart_s = true) then begin
CL1 = Close data1;
CL2 = Close data2;
print(datetimetostring(datetime)," ", "Close data1= ",CL1, " Close Data2 ", CL2, " Time ", Time_s);
end; //: LastBarOnChart