Divergence Tool – Backtest

Optuma Forums Optuma Scripting Divergence Tool – Backtest

Tagged: 

  • This topic has 4 replies, 3 voices, and was last updated 1 week ago by Mark.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #66203
    Mark
    • Topics: 1
    • Replies: 2
    • Posts: 3

    Hello, I am trying to do a backtest using the Divergence tool to show positive divergence between Price and a 13 period RSI but having a difficult time. It is not identifying all trades and is taking some trades that are not indicated. I have gone through all of the tutorials but I am still having trouble determining the coding syntax and what is returned. The exit criteria is the same except for type = negative, however it’s closing the trades on positive divergence and ignoring the negative divergence. Thank you.

    • This topic was modified 2 weeks ago by Mark.
    #66251
    Matthew
    • Topics: 5
    • Replies: 430
    • Posts: 435

    Hi Mark,

    The Divergence() function doesn’t have a Type field to reference.  The way it works is a result of +1 is a positive divergence and -1 is a negative divergence.

    ex4

    If you wanted to buy for a positive divergence you could use:

    and to exit on a negative divergence would be:

    If you apply a divergence script via a Show View along the bottom of the chart you will see where it is triggering for positive / negative divergence. Not every bar in the shaded zone will be a match, to see why i’d recommend viewing the chart with training mode, you can see how the zones build as new data comes in).

    #66263
    Mark
    • Topics: 1
    • Replies: 2
    • Posts: 3

    Thank you Matthew, I appreciate the quick response and insight.  Just a follow up question, how do I tell what fields a function returns. I know some of them are listed using the dot script but some either do not list anything or have fields not listed?

    I saw a reference of a white paper on scripting but when I clicked the link an error message was returned.

    thank you,

    #66269
    Darren
    • Topics: 66
    • Replies: 679
    • Posts: 745

    Hi Mark,

    Either using the dot notation or clicking on the function text will show you the outputs available under Default Plot, eg for MACD:

    Capture

    The divergence function is different in that it’s a true / false signal so you will see the output values (+1 / -1) when using it in a Show View as per Matthew’s example above.

    As for the whitepaper please send the link to support and we’ll get it fixed. If you haven’t already done so, I’d highly recommend the 3 scripting tutorial courses available when signing in here:

    https://learn.optuma.com/optuma-courses/

    #66275
    Mark
    • Topics: 1
    • Replies: 2
    • Posts: 3

    Hi Darren,
    I found the paper https://dl.optuma.com/public/files/MarketAnalyst8-Scripting.pdf and the link is working so all good.

    Thanks for your response.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest