Reply To: SCRIPTING: OFFSET FROM SIGNAL

Optuma Forums Optuma Scripting SCRIPTING: OFFSET FROM SIGNAL Reply To: SCRIPTING: OFFSET FROM SIGNAL

#45055
HenryHenry
  • Topics: 0
  • Replies: 14
  • Posts: 14

Hi Trevor,

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)

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close