- Topics: 0
- Replies: 14
- Posts: 14
Offset() only returns value according to the Bar position instead of the Signal position.
It is a good idea to have a different Offset() that could easily point to the previous / next signal. I will pass it on to the team.
In the meantime, here is the script to look for the signal that is lower than the next signal (using -1 as offset value)
GS2ndTopSignal = SCRIPT(SCRIPTNAME=Test);
// use IF() to give the High at the Signal and fill the other positions with zero
Value1 = If(GS2ndTopSignal > 0, PriceAtSignal(GS2ndTopSignal, PRICE=High), 0);
// Use NonZero() to shrink the Value1 list by removing the zeros so it can use Offset() to find the next / previous signal
Signal1 = NONZERO(Value1);
Signal1 < OFFSET(Signal1, OFFSET=-1)