Conversion Pivot Reversal Strategy Alerts from Tradingview Pine script v3

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #91321 quote
    didi059
    Participant
    Junior

    Tradestation Indicator Pine Script Version 3

    Pivot Reversal Strategy Alerts by Kozlod

     

    See attachment for code and screen

    First it will be necessary to program 2 new functions: pivothigh and pivotlow

    Pivot High :Pivot Point Highs are determined by the number of bars with lower highs on either side of a Pivot Point High.

    Pivot Point Lows are determined by the number of bars with higher lows on either side of a Pivot Point Low

    pivot-reversal-strategy.png pivot-reversal-strategy.png pivot-reversal-strategy-indicator-.jpg pivot-reversal-strategy-indicator-.jpg
    #91337 quote
    Vonasi
    Moderator
    Master

    didi059 – Please paste the code into your post rather than attaching a screen image of your code. This will make it more readable for others. Also providing an attachment of the original source code helps. This makes it easier for others to help you with your request.

    #91341 quote
    didi059
    Participant
    Junior
    //@version=3
    study("Kozlod - Pivot Reversal Strategy Alerts", overlay=true)
    
    // 
    // author: Kozlod
    // date: 2018-03-11
    // 
    
    ////////////
    // INPUTS //
    ////////////
    
    leftBars = input(4)
    rightBars = input(2)
    
    /////////////
    // SIGNALS //
    /////////////
    
    swh = pivothigh(leftBars, rightBars)
    swl = pivotlow(leftBars,  rightBars)
    
    swh_cond = not na(swh)
    
    hprice = 0.0
    hprice := swh_cond ? swh : hprice[1]
    
    le = false
    le := swh_cond ? true : (le[1] and high > hprice ? false : le[1])
    
    swl_cond = not na(swl)
    
    lprice = 0.0
    lprice := swl_cond ? swl : lprice[1]
    
    se = false
    se := swl_cond ? true : (se[1] and low < lprice ? false : se[1])
    
    // Filter out signals if oposite signal is also on
    se_filt = se and not le
    le_filt = le and not se
    
    // Filter out consecutive signals 
    prev = 0
    prev := se_filt ? 1 : le_filt ? -1 : prev[1]
    
    se_final = se_filt and prev[1] == -1
    le_final = le_filt and prev[1] == 1
    
    // Plot Signals
    plotshape(se_final, color = red, text = "se")
    plotshape(le_final, color = green, text = "le")
    
    // Create cistom alserts
    alertcondition(se_final, "se", "se")
    alertcondition(le_final, "le", "le")
    
    #91393 quote
    Nicolas
    Keymaster
    Master

    I made a complete new code based on this “strategy” (pinescript is from Tradingview, not tradestation).

    It is now available in the library: Pivot Reversal Strategy Alerts

    didi059 thanked this post
    pivot-points-high-low-breakout.png pivot-points-high-low-breakout.png
    #91398 quote
    didi059
    Participant
    Junior

    Dear Nicolas

     

    Thank you for this work and sorry for the lapsus (this what happens when you are tired…)

    May be the administrator can correct the title…

    #91409 quote
    Vonasi
    Moderator
    Master

    Title changed as requested!

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

Conversion Pivot Reversal Strategy Alerts from Tradingview Pine script v3


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
didi059 @didi059 Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Vonasi
6 years, 12 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/13/2019
Status: Active
Attachments: 3 files
Logo Logo
Loading...