Hello muhaha2015,
If you would like to base your indicator on Data 2, please go to Format - Study and click the gear icon next to Moving Average. Then go to Properties tab and in the Base Study On section select the necessary data series.
Hello Vlada, thank you for the fast reply.
Following your method indeed works, but my problem is how to get the calculation of data2 before the first bar of data1 when data2 have more data range.
Code: Select all
var:
var0(0);
condition1 = close > close[1] and close[1] > close[2] ;
if condition1 then var0 = close;
plot1(var0,"var0");
Code: Select all
var:
var0(0);
condition1 = close data2 > close[1] data2 and close[1] data2 > close[2] data2;
if condition1 then var0 = close data2;
plot1(var0,"var0");
Data 1 is 1 min , 5 days range
Data 2 is 1 day , >10 days range
If I base the upper indicator on Data 2, var0 is calculated before bar1 of data1, so there will be value in var0 instead of 0 at bar1 of data1, but then I can't compare the value with other value of data1 cause it's a indicator base on data2.
If I write it like in the lower code and base on data1, the condition calculation start after bar1 of data1, and var0 will be 0 until condition1 happened after bar1 of data1.
So how can I get the value calculated on data2 before bar1 of data1, so I can use it with other value calculated base on data1?
Hope you may help, Many Thanks.