Using Pivot(), but Not Working with Other Signals

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

Tagged: 

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #53699
    AvatarTrevor R
    • Topics: 79
    • Replies: 249
    • Posts: 328

    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: 79
    • Replies: 249
    • Posts: 328

    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: 269
    • Posts: 273

    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: 79
    • Replies: 249
    • Posts: 328

    Many thanks Matthew.

    #54263
    AvatarMay
    • Topics: 10
    • Replies: 17
    • Posts: 27

    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: 53
    • Replies: 428
    • Posts: 481

    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: 10
    • Replies: 17
    • Posts: 27

    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: 269
    • Posts: 273

    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: 10
    • Replies: 17
    • Posts: 27

    Got it. Many thanks to Matt and Darren!

    #57325
    AvatarMay
    • Topics: 10
    • Replies: 17
    • Posts: 27

    Re: Quote#53705 above

    In the ASX chart, is it possible to compare non-adjacent pivots?  I want to know whether there are 3 pivots that each is higher than the previous one. in chronological order.

    e.g. 201 is higher than 53 and 53 is higher than 18.  201 is also higher than 16 and 16 is higher than 12.

    As 201 is the current pivot and I want to look backward, SIGNALAFTER() cannot be applied.

    #57342
    MatthewMatthew
    • Topics: 4
    • Replies: 269
    • Posts: 273

    Hi May,

    The following script is an example of how you can find 3 higher pivot labels in a row:

    #57343
    AvatarMay
    • Topics: 10
    • Replies: 17
    • Posts: 27

    However, this does not work on the examples mentioned when those values are not in consecutive order.  The two examples mentioned cannot be identified by this script. So is there a function that can rank the values first and then by chronological order?

    #57344
    MatthewMatthew
    • Topics: 4
    • Replies: 269
    • Posts: 273

    Hi May,

    If you can provide a screen shot example(s) of the setup you’re trying to identify it will be easier to see if a scripting solution is possible or not.

    #57345
    AvatarMay
    • Topics: 10
    • Replies: 17
    • Posts: 27

    As attached screenshot, I am trying to identify a Wedge Up pattern.  Show View shows the price difference between the Pivot High and Pivot Low.  I want to identify if the price difference of any 3 bars in Show view are decreasing in value.  The first 3 bars in May-Jul can be identified by the Script you mentioned because they are consecutive in a row.  But the 3 bars Bar 4,5,7 also qualified.

    So I need to sort the bars by date (can use BARDATE() to identify the date of Pivot High), and see how many groups of 3 bars that match the criteria?

    If look back period = 6 months, there are 4 bars, Bar 4 – 7.   Bar 4,5,7 is the group that match.

    If look back period = 1 year, there are 7 bars in total, Bar 1-7.  There are 4 groups that match.

    group 1 = Bar 1, 6, 7

    group 2 = Bar 4,5,7

    group 3 = Bar 1,4,7

    group 4 = Bar 1,5,7

    Kindly advise.

     

    Capture

    #57347
    AvatarMay
    • Topics: 10
    • Replies: 17
    • Posts: 27

    As attached screenshot, I am trying to identify a Wedge Up pattern.  Show View shows the price difference between the Pivot High and Pivot Low.  I want to identify if the price difference of any 3 bars in Show view are decreasing in value.  The first 3 bars in May-Jul can be identified by the Script you mentioned because they are consecutive in a row.  But the 3 bars Bar 4,5,7 also qualified.

    So I need to sort the bars by date (can use BARDATE() to identify the date of Pivot High), and see how many groups of 3 bars that match the criteria?

    If look back period = 6 months, there are 4 bars, Bar 4 – 7.   Bar 4,5,7 is the group that match.

    If look back period = 1 year, there are 7 bars in total, Bar 1-7.  There are 4 groups that match.

    group 1 = Bar 1, 6, 7

    group 2 = Bar 4,5,7

    group 3 = Bar 1,4,7

    group 4 = Bar 1,5,7

    Kindly advise.

     

    Capture

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