Hey guys,
I am working on an indicator in Tradestation which should show whether the last price is above/below the opening range (9:30 to 10:30). The indicator has to work on a 2min timeframe (radarscreen) since I am also measuring the price against some moving averages on the that timeframe.
I was thinking of starting to store the (new) high and low from 9:30 to 10:30 and the print it at 10:30 so that it wont change after 10:30 but somehow the function for now always returns the LAST2min bar high/low.
Basically I want to check the price at any time after 10:30 against the high/low of the first 60min of the day but cant use 60min timeframe due to the other indicators running on the 2min timeframe.
Not sure how to fix it. Maybe you have an idea, I post the code below.
Thanks!
vars: myhigh(0), mylow(0), abovebelowOR(0);
If Time =0932 then
Begin
myhigh=High;
end;
If high>myhigh then
Begin
myhigh=high;
end;
If time=1030 then
Begin
print(myhigh:0:2);
end;
plot1(myhigh,"H",green,black);
If Time =0932 then
Begin
mylow=low;
end;
If low>mylow then
Begin
mylow=low;
end;
If time=1030 then
Begin
print(mylow:0:2);
end;
plot2(mylow,"L",red,black);
If Time>1030
And last>myhigh then
Begin
abovebelowOR=1;
plot3(abovebelowOR,"AB",black,green);
End;
If Time>1030
And last<mylow then
Begin
abovebelowOR=-1;
plot3(abovebelowOR,"AB",black,red);
End;
If Time>1030
And last<myhigh
And last>mylow Then
Begin
abovebelowOR=0;
plot3(abovebelowOR,"AB",black,white);
end;