Using Pivot(), but Not Working with Other Signals

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

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by Avatar Trevor R 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #53699
    Avatar
    Trevor R
    • Topics: 40
    • Replies: 124
    • Posts: 164

    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
    Avatar
    Trevor R
    • Topics: 40
    • Replies: 124
    • Posts: 164

    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
    Matthew
    Matthew
    • Topics: 4
    • Replies: 165
    • Posts: 169

    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
    Avatar
    Trevor R
    • Topics: 40
    • Replies: 124
    • Posts: 164

    Many thanks Matthew.

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