Reply To: IF Statement

Optuma Forums Optuma Scripting IF Statement Reply To: IF Statement

#60295
AvatarThomas
  • Topics: 78
  • Replies: 102
  • Posts: 180

Hi Trevor,

many thanks for your fast response. But the issue seems to be more complicated than thought. Here is the screenshot of the chart:

S P 500

As you can see there are numerous times when the tool moved from “1” to “-1” although it shouldn’t or stayed at “0” although there was no reason to stay there.

For example in the time period between mid October 2019 to mid January 2020 the value of the trend indicator should be always at “1”. The same is the case in the time period between end of March 2020 and mid June 2020 it should be a value of “1”. And so on.

To make my issue a little bit more clearer:
If the raw calculation (the histogram or Var3) moves from a negative value to plus 0.3 or more the trend value should be “1” at the first bar that has a raw calculation of plus 0.3 or more and this value of “1” should be in effect until a raw value of minus 0.3 or more is reached.
On the other hand, if the raw calculation (the histogram or Var3) is positive and moves to minus 0.3 or more the trend value should be “-1” at the first bar that has a raw calculation of minus 0.3 or more and this value of “-1” should be in effect until a raw value of plus 0.3 or more is reached.

Perhaps the “Switch Function” could be used.

Many thanks,
Thomas

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