Reply To: SCRIPTING: OFFSET FROM SIGNAL

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

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

Hi Trevor,

I found some minor changes in #4 section to achieve your goal.

After looking at the plots of GS1stTopValue and GS2ndDTopValue in Show View, the 1st Top value you are looking for is actually GS1stTopValue[1] or Offset(GS1stTopValue, OFFSET=1) which is the previous Bar value of the GS1stTopValue. Because they become equal when swings turn at the 2nd Top.

So here is the script for #4

// #4 +++++ Compare 1st and 2nd Top, 2nd Top to be between 0 and 0.5% higher than 1st Top

// Get Double Top High Prices

GS1stTopValue = PRICEATSIGNAL(GS1stTopSignal, PRICE=High);

GS2ndDTopValue = PRICEATSIGNAL(GS2ndTopSignal, PRICE=High);

// % range between 1st Top and 2nd Top

DoubleTopRatio = 100 * (GS2ndDTopValue – GS1stTopValue[1]) / GS1stTopValue[1];

// Test if Top Ratio in range -0.25 to +0.25

DoubleTopSignal = If(GS2ndTopSignal AND DoubleTopRatio >= 0 AND DoubleTopRatio < 0.5 , 1, 0);

DoubleTopSignal

 

Cheers

Henry

Attachments:

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