Optuma Pivot Script Not Working Correctly

Optuma Forums Optuma Scripting Optuma Pivot Script Not Working Correctly

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #56467
    • Topics: 44
    • Replies: 22
    • Posts: 66

    Hi team

    I have been using Darren’s breakout pivot script to identify potential areas of support:

    //Define the pivot criteria
    V1=PIVOT(MIN=15, TYPE=Low);
    //Get the current high price and when the last V1 pivot occurred
    V2=VALUEWHEN(LOW(), V1);
    //Calc 1% rule

    When I backtested a buy within 1% of a prior low – I found the backtest cheating and taking trades on the day a new pivot formed as opposed to an existing pivot (at that time).

    What’s a possible way to test this style of pivot support?

    Thank in advance



    • Topics: 62
    • Replies: 503
    • Posts: 565

    Hi Mandeep,

    This is a known issue when using the PIVOT function in testing because the labels can change depending on new data coming in to the chart. As such, pivot scripts should only be used to display on the chart, and not for testing.

    Instead you could use values of swing lows instead of pivots using something like this, but I haven’t tried it in testing:

    • Topics: 44
    • Replies: 22
    • Posts: 66

    Thanks Darren – I tested this signal and it looks like this one is cheating too.

    Would it work better if you use:


    I am looking a hack solution – what do you think of this: trying to force the system to at least have a 5day lag between the last pivot low ??

    V1=PIVOT(MIN=10, TYPE=Low);

    TIMESINCESIGNAL(V1<=-11) > 5




Viewing 3 posts - 1 through 3 (of 3 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.