Optex Bands

Optuma Forums Optuma Scripting Optex Bands

This topic contains 5 replies, has 2 voices, and was last updated by Avatar Thomas F. 1 month, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #54301
    Avatar
    Thomas F.
    • Topics: 23
    • Replies: 29
    • Posts: 52

    Hi,

    I have a question concerning a script for coloring bars according to values of the “Ratio Line” of the Optex Bands indicator.

    What I want is a script that colors the bars of e.g. the S&P 500 in green when the “Ratio Line” of the Optex Bands indicator is less than -1.

    e.g. Ratio Line Optex Bands<=-1

    I know how the settings have do be made in the “Properties” panel of the chart for coloring the bars. I only need the script.

    Many thanks for your help.

    Thomas

    #54305
    Darren
    Darren
    • Topics: 41
    • Replies: 280
    • Posts: 321

    Hi Thomas,

    Simply type OPTEX(). and then select the output value required, ie Ratio

    OPTEX().Ratio<=-1

    Capture

    #54307
    Avatar
    Thomas F.
    • Topics: 23
    • Replies: 29
    • Posts: 52

    Hi Darren,

    thanks again for your fast answer.

    The script works of course fine.

    #54313
    Avatar
    Thomas F.
    • Topics: 23
    • Replies: 29
    • Posts: 52

    Hi,

    I want just a bit modify the Optex Bands indicator in that way that I want calculate a moving average of the “Ratio Line”. On the chart this is of course no problem but I have some problems with the script.

    I have tried the following but it does not work:

    MA(CALC=OPTEX().Ratio, STYLE=Weighted, BARS=2)<=0

    The script without a moving average is:

    OPTEX().Ratio<=0

    I thought I can change the “Close” element of “CALC=Close” with CALC=OPTEX().Ratio but as already mentioned it does not work.

    Can anyone give me some advice in this issue?

    Thank you very much.

    #54317
    Darren
    Darren
    • Topics: 41
    • Replies: 280
    • Posts: 321

    Hi Thomas,

    The CALC field refers to the MA, eg based on closing prices, high, etc. Click on the properties box to see available options:

    Capture

    Instead, the item that the moving average is calculating needs to be separated by a comma:

    MA(OPTEX().Ratio, BARS=2, CALC=Close, STYLE=Weighted)<=0

    For more examples of ‘nesting’ functions see the first lecture here:

    https://learn.optuma.com/course/intermediate-scripting/

    #54325
    Avatar
    Thomas F.
    • Topics: 23
    • Replies: 29
    • Posts: 52

    Hi Darren,

    many thanks again for your help. The assistance I already get from you is priceless!

    My next step will be the scripting courses. I have already downloaded all courses and example materials but had not yet the time to work through.

    Thomas

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

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