Script help to return a specific value
Posted: Tue Mar 14, 2017 10:59 am
Hi, I am trying to get the highest high value and the lowest low value for the previous 10 bars, which I can do with either of the following:
ShortCycle10: (HHV(H, 10)) == H;
LongCycle10: (LLV(L, 10)) == L;
Event: ShortCycle10 | LongCycle10
Event: LongCycle10 | ShortCycle10
Alternatively:
HC10:HHV(HIGH,P1),ColorRed;
LC10:LLV(LOW,P2),ColorGreen;
However, I would like to return a value of 2 otherwise 0 for the HHV and a -2 otherwise 0 for the LLV.
Can someone help?
ShortCycle10: (HHV(H, 10)) == H;
LongCycle10: (LLV(L, 10)) == L;
Event: ShortCycle10 | LongCycle10
Event: LongCycle10 | ShortCycle10
Alternatively:
HC10:HHV(HIGH,P1),ColorRed;
LC10:LLV(LOW,P2),ColorGreen;
However, I would like to return a value of 2 otherwise 0 for the HHV and a -2 otherwise 0 for the LLV.
Can someone help?