Reply To: Valuewhen()

Optuma Forums Optuma Scripting Valuewhen() Reply To: Valuewhen()

#61829
AvatarMay
  • Topics: 14
  • Replies: 18
  • Posts: 32

Thanks Mathew!  It works fine on current swing.

As I want to compare the corresponding RSI values at previous swing ends, I used the scripts below but did not work out (As attached, value of R1 in lower panel is the same as R0 in upper one somehow).

I believe I should use the dot notation as recommended in the article for both current scanning and backtesting purposes.

//Gann Swings
//Current Swing
S0 = SWINGEND(GANNSWING(SWINGCOUNT=2, DEFAULT=SwingList, METHOD=Use Next Bar));

//Previous Swings
S1 = OFFSET(S0, OFFSET=1);
S2 = OFFSET(S0, OFFSET=2);

//Swing Ends
SE0 = S0.SWINGEND();
SE1 = S1.SWINGEND();

//Corresponding RSI value of the Swings
R0 = VALUEWHEN(RSI(BARS=14),SE0);
R1 = VALUEWHEN(RSI(BARS=14),SE1);

R1

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