Using Pivot(), but Not Working with Other Signals

Optuma Forums Optuma Scripting Using Pivot(), but Not Working with Other Signals

Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #53699
    AvatarTrevor R
    • Topics: 60
    • Replies: 190
    • Posts: 250

    Hi All,

    I have a script intended to identify a potential Short Entry following an Outside Bar with a Low Close at a Pivot that is followed by a Down Bar. Here is my script:

    When I test each “***Signal” separately as a SHOWBAR they will identify the desired signal, as does “OutsideSignal and EntrySignal”, but as soon as I try “PivotSignal and OutsideSignal and EntrySignal” no SHOWBAR is displayed.

    In the following screenshot the Diamond is above a bar that meets all criteria, but there is no SHOWBAR present:

    20190616  High Pivot Outside Bar Low Close Short Entry

    What am I missing here? Is there something in the way the Pivot() function works that is preventing the combined signals from being registered? How to overcome this issue?

    Cheers

    Trevor

     

    #53701
    AvatarTrevor R
    • Topics: 60
    • Replies: 190
    • Posts: 250

    Hi All,

    Standing under the shower I had a bright idea  and so I changed my PivotSignal code to:

    PivotSignal = if(PIVOT(MIN=11, TYPE=High), 1, 0);

    Now “PivotSignal and OutsideSignal and EntrySignal” works as intended.

    But, I still don’t understand why. My understanding is that “PIVOT(MIN=11, TYPE=High)” returns “1” which I’d have expected would work, but it seems that is not so. Any explanation as to why will be appreciated.

    Cheers

    Trevor

     

    #53705
    MatthewMatthew
    • Topics: 4
    • Replies: 216
    • Posts: 220

    Hi Trevor,

    This line doesn’t return a Boolean result, it returns values grater than zero based on the bar count between pivots.  If you apply it to the chart using a Show View you can see what it’s doing:

    ex1

    By wrapping the IF() function around the PIVOT() line, you changed the result to a true Boolean which allowed the rest to work as expected.

    #53711
    AvatarTrevor R
    • Topics: 60
    • Replies: 190
    • Posts: 250

    Many thanks Matthew.

    #54263
    AvatarMay
    • Topics: 6
    • Replies: 10
    • Posts: 16

    Hi Matt,

    In your chart of ASX above, how to script the difference between two Pivot Labels, say (201 – 25) bars as the offset period is a variable?  My below script does not work:

    V1 = PIVOT(MIN=10, TYPE=High, DIR=Backwards);

    V3 = TIMESINCESIGNAL(V1);

    V1 – V1[V3]

    #54283
    DarrenDarren
    • Topics: 43
    • Replies: 304
    • Posts: 347

    Hi May,

    To show the time between each pivot use the following:

    So there were 27 trading days between H25 and H201 in the example (displayed in a Show View, set to dots). Is that what you are trying to do?

    Capture

    #54291
    AvatarMay
    • Topics: 6
    • Replies: 10
    • Posts: 16

    Hi Darren,

    Thanks for comment.  But no.

    What I want is to compare the value of two Pivot Labels.  i.e. I want to script for (201 – 25) = 176 bars, (25-16) = 9 bars, and so on so forth.  Then I can do show view or scan to find when there is a jump to indicate that particular Pivot Label is a significant level breakout over time.

     

    #54295
    MatthewMatthew
    • Topics: 4
    • Replies: 216
    • Posts: 220

    Hi May,

    To do this you need to use a few functions:  Pivots, NONZero and IF.  In the example below I’ve included some comment lines showing what each line is doing:

    You can see how the above script looks when applied to a Show View:

    Ex1

    #54315
    AvatarMay
    • Topics: 6
    • Replies: 10
    • Posts: 16

    Got it. Many thanks to Matt and Darren!

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