Conversion of “PriceActionSwing” indicators package for NinjaTrader 7.0+8.0

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #168916 quote
    anjoloro
    Participant
    Junior

    The “PriceActionSwing” indicators package for NinjaTrader 7.0 (or 8.0) calculates swings in different ways and visualize them. It shows swing information like the swing length, duration, volume,… It contains a lot of features. It is also useable on the Market Analyzer.
    The package contains 3 indicators:
    1) PriceActionSwing
    – standard swing indicator with visualization and swing information
    2) PriceActionSwingPro
    – Draw automatically Fibonacci extensions and retracements
    – Calculate a swing statistic
    – Calculate and visualize ABC patterns
    – Risk management (automatically for ABC patterns)
    – Calculate and visualize divergence based on an indicator
    – GomCD (uncomment the “region GomCD” parts in the source code)
    3) PriceActionSwingOscillator
    – swing trend visualization
    – developing swing volume (repainting)
    Useful to see/trade price action with HH, HL in uptrends and LL, LH in downtrends and patterns like double top/bottom, triangle,…

    For more information see this:
    * For Ninja Trader 7.0: https://futures.io/local_links.php?catid=26&linkid=57
    * For Ninja Trader 8.0: https://futures.io/local_links.php?action=ratelink&catid=26&linkid=1781

    I have attached one of the files you can download for free from the aforementioned web sites (the one for Ninja Trader 8.0 only).

    Thank you guys, in advance.

    anjoloro

    TwilightD thanked this post
    PriceActionSwing-NT8-Indicators.zip
    #168932 quote
    Nicolas
    Keymaster
    Master

    Sorry but do you want that indicators converted to ProRealTime? Can you share pictures of the indicator(s) to understand what it is all about please? Thanks in advance.

    #168944 quote
    anjoloro
    Participant
    Junior

    Yes, Nicolas, I would like to get (and share) the “PriceActionSwing” Ninja Trader indicators package converted to a ProRealTime version.
    Please take into account that I do not have Ninja Trader. That is the reason why I cannot provide you the Ninja code itself.
    However, I have taken a screenshot from a video and pasted it in the attached Word file. Hope it will be helpful.

    One of the things that the Ninja indicators provide is the cumulative volume of a bullish or bearish swing. I have checked that you coded in 2017 an indicator for the same purpose ( https://www.prorealcode.com/prorealtime-indicators/zigzag-cumulative-volume/ ). Your indicator works perfectly for daily or weekly timeframes but, if I am not wrong, it does not capture intraday swings. It would be great if your indicator could be modified so that it could also be applicable for intraday trades (for timeframes like, let’s say, 1 to 5 minutes or so).

    In addition, I would also appreciate if the indicator could also plot (in the price area) the segments for the ABC patterns, linking the same peaks and toughs that are used for the cumulative volume calculations.

    Thank you for your patience and your super-useful work.
    Please, do not hesitate to contact me for any further question.
    anjoloro

    TwilightD thanked this post
    PriceActionSwing-NT-Indicators-screenshot.docx
    #168962 quote
    Nicolas
    Keymaster
    Master

    That whole package of indicators represent almost 10.000 lines of code. Diving into that would take days, even for me. Please explain me in simple words what you expect to be plotted on the chart and I will do it from scratch or with part of things already done in the website, like you stated. Thanks.

    #168965 quote
    anjoloro
    Participant
    Junior

    OK, understood, Nicolas. So let’s forget about the Ninja codes and talk about smaller targets:

    1) Modify the code of the 2017 “ZigZag Cumulative Volume” indicator ( https://www.prorealcode.com/prorealtime-indicators/zigzag-cumulative-volume/ ) so that it can also be used for intraday trades (taking into account, for the zigzag cumulative volume calculations, the swings you see on a 2 minutes timeframe + 200 price bars). In other words, once the megatrends are already covered by the indicator, I would also like to use the same indicator for the microtrends.

    2) Modify the new “ZigZag Cumulative Volume” indicator code (the one resulting from target 1 above) so that it plots (in the price chart) the segments that link the meaningful peaks and toughs that are used for the zigzag cumulative volume calculations. Whenever the timeframe is changed by the user, the meaningful swings to be considered should be different, as well as the peaks and toughs inside the swings.

    I really don’t know how hard this can be. However, I presume it’s much easier. Please let me know if you need further explanations.

    Merci beaucoup et très bonne soirée.
    anjoloro

    TwilightD thanked this post
    #168986 quote
    anjoloro
    Participant
    Junior

    Hello again, Nicolas.

    Target 1) above is solved already. It required just to adapt the “percentVariation” parameter to the desired timeframe. For example, percentVariation = 9 (aprox) for a 2 days timeframe and percentVariation = 9/22 (aprox) for a 5 minutes timeframe. Please find attached the modified code.
    Kindly let me know if target 2) above is doable.
    Thanks a lot.
    anjoloro

    // ZigZag Cumulative Volume indicator  17.02.2017  Nicolas @ www.prorealcode.com
    // 06.05.2021 modified version by anjoloro
    // The theory that supports this indicator is based on R. Wyckoff works and refined by D. Weis. In the nutshell cumulative volume helps to asses the strength of the ZigZag section which is difficult to measure if you look at the individual volume bars only.
    // The indicator works with percent variation ZigZag. The new peak or tough is triggered by a new price variation of X percent you can change with the "percentVariation" parameter in the indicator window.
     
    // Parameters
    
    percentVariation = 9/22    // Adapted for a 5 MINUTES TIMEFRAME.       percentVariation = 9 (aprox) for a 2 DAYS TIMEFRAME
    zz = ZigZag[percentVariation](close)
    peak = (zz<zz[1]) and (zz[1]>zz[2])
    tough = (zz>zz[1]) and (zz[1]<zz[2])
    cumV = cumV + volume
    
    // Calculations
     
    if peak then
    text = round(cumV[1]/1000,1)
    drawtext("#text#K",barindex[1],cumV[1]+0.17*cumV[1],Dialog,Bold,14) coloured(0,200,0)
    drawsegment(barindex[1],cumV[1]+0.20*cumV[1],previousX,previousY)
    cumV = Volume
    color = -1
    previousX = barindex[1]
    previousY = cumV[1]+0.20*cumV[1]
    elsif tough then
    text = round(cumV[1]/1000,1)
    drawtext("#text#K",barindex[1],cumV[1]+0.23*cumV[1],Dialog,Bold,14) coloured(200,0,0)
    drawsegment(barindex[1],cumV[1]+0.20*cumV[1],previousX,previousY)
    cumV = Volume
    color = 1
    previousX = barindex[1]
    previousY = cumV[1]+0.20*cumV[1]
    endif
    
    // Results plotting
     
    return cumV coloured by color
    
    #169002 quote
    anjoloro
    Participant
    Junior

    Bonjour, Nicolas.
    I have now realized that maybe the ZigZag indicator (the one which is installed by default in ProRealTime) is key for target 2) above. It draws the segments I referred to, the links between the meaningful peaks and toughs. And, again, the one who defines which peaks and toughs are meaningful is the user, in accordance with the timeframe he (or she) is working with, just through the selection of the right “percentVariation”. So now target 2) has to be rephrased:

    2) Modify the latest version of the “ZigZag Cumulative Volume” indicator code (the one I posted yesterday right here) so that it plots many things at the same time, all of them related to the timeframe (–> to the “percentVariation”) the user has selected for the chart:

    2a) It should plot (at the bottom of the screen, NOT IN THE PRICE AREA) the cumulative volume the market produces from a meaningful peak/tough to the next meaningful peak/tough –> this is what we have already.
    2b) It should also plot (IN THE PRICE AREA, overlapping the price bars) the segments that link the same meaningful peaks and toughs that are being used for target 2a) –> this is what I presume is doable (somehow) through the ZigZag PRT indicator.

    What I do not know is:
    * Is it possible that one single indicator plots different things in different screen areas (the price area and another one)?
    * Is it possible that, just through the timeframe selection (by the user), the value of the “percentVariation” parameter is automatically allocated, so that the graphs for both 2a) and 2b) are automatically adapted to the selected timeframe?

    Well, little by little, we are getting closer. But I still need your super-powers, Nicolas!!! 😉
    À très bientôt, j’espère.
    anjoloro

    #169259 quote
    anjoloro
    Participant
    Junior

    I have also found this, which can be useful:

    Weis Wave

    Please, Nicolas, let me know if you are working (or going to work) on this or I should better look for help somewhere else.
    Thank you!

    #169278 quote
    Nicolas
    Keymaster
    Master

    I’m sorry but I’m very busy currently..

    It’s rather difficult to know which percent variation is the best for the current timeframe. It should obviously be “dynamic”, this is something you can test:

    factor = 1.618 //whatever factor 
    
    a=cumsum(range)/barindex //average of candlesticks size
    percent=((a/close)*100)*factor // adjust a percentage variation
    #169429 quote
    anjoloro
    Participant
    Junior

    Thanks, Nicolas.

    In order to automatically detect the timeframe (and adjust the proper value for the “percentVariation” parameter), I have tried many things, including what you suggested on your message above. Everything failed and I cannot find the reason why. Any help would be welcome.

    Anyway, I had to go on. Therefore, I abandoned one of my original wishes (to auto-detect the timeframe) but, fortunately, I could put together cumulated volume and price variation (for the concerned Weis wave leg) in one single indicator. The attached files are ready for a 5 minutes timeframe. Should a different timeframe be required, the user has to clone the indicator and change the “percentVariation” value in the code. A kind of table for the timeframe vs “percentVariation” correlation is included in the code.

    * 5m Onda Weis: it has to be inserted overlapping the price chart (it works with the price vertical scale).
    * 5m Cumul Volume: it has to be inserted under the price chart (it works with a different scale). Since “5m Onda Weis” also prints the cumulated volume on the price chart, the “5m Cumul Volume” is not compulsory, but it may help the user to understand how they both work.

    This is not a final version, but it is quite useful already (in my opinion). Hope someone else agrees with me. There it goes! 😉

    TwilightD thanked this post
    5m-Onda-Weis.itf 5m-Cumul-Volume.itf
    #169503 quote
    JC_Bywan
    Moderator
    Master

    Topic moved from Spanish forum “Soporte Probuilder” to the English forum “Probuilder Support” (please see rule of using matching language and forum in yellow box below, thanks)

    #169511 quote
    anjoloro
    Participant
    Junior

    Thanks, Noobywan.

    Sorry, my fault.

    #169556 quote
    christophe11560
    Participant
    Senior

    Hello,
    I am currently working on the 2 indicators developed by David WEIS:
    – Cumulative Weiss Wave Volume (Histogram)
    – Zigzag Weiss Wave Volume (Bar)
    I think I’m on the right track, however, I have an error on the cumulative “text” value of the volume on the histogram and on the wave.
    I send you my codes for advice

    #169558 quote
    christophe11560
    Participant
    Senior
    //erreur sur texte cumul volume?
    //p=2
    defparam calculateonlastbars = 400
    trendDetectionLength=p
    
    if close>close[1] then
    mov=1
    elsif close<close[1] then
    mov=-1
    else
    mov=0
    endif
    
    if mov <>0 and mov <> mov[1] then
    trend=mov
    else
    trend=trend[1]
    endif
    
    rising=abs(close-close[1])>=abs(close-close[trendDetectionLength])
    falling=abs(close-close[1]<abs(close-close[trendDetectionLength]))
    
    if rising or falling then
    isTrending= rising or falling
    endif
    
    if trend <> wave[1] and isTrending then
    wave=trend
    else
    wave=wave[1]
    endif
    
    if wave=wave[1] then
    vol=vol[1]+volume
    else
    vol=volume
    endif
    
    if wave=1 then
    up=vol
    dn=0
    elsif wave=-1 then
    up=0
    dn=vol
    else
    up=0
    dn=vol
    endif
    
    peak = up<up[1] and up[1]>up[2]
    tough = dn<dn[1] and dn[1]>dn[2]
    cumV = cumV+volume
    up=up+volume
    dn=dn+volume
    
    if peak then
    text = round(cumv/1000)
    drawtext("#text#K",barindex[1],up[1]+0.17*up[1],Dialog,Bold,12) coloured(0,200,0)
    cumV = up
    elsif tough then
    text = round(cumv/1000)
    drawtext("#text#K",barindex[1],dn[1]+0.23*dn[1],Dialog,Bold,12) coloured(200,0,0)
    cumV = dn
    endif
    
    return up coloured (0,128,0)style(histogram)as "up",dn coloured(255,0,0)style(histogram)as "dn"
    #169559 quote
    christophe11560
    Participant
    Senior
    //Erreur sur valeur texte cumulée volume
    //---external parameters
    //cp = 20
    defparam calculateonlastbars = 400
    once lastpoint = 0
    
    if high[round(cp/2)] >= highest[round(cp+1)](high) then
    LH = 1
    else
    LH = 0
    endif
    
    if low[round(cp/2)] <= lowest[round(cp+1)](low)  then
    LL = -1
    else
    LL = 0
    endif
    
    if LH = 1 then
    TOPy = high[round(cp/2)]
    TOPx = barindex[round(cp/2)]
    endif
    
    if LL = -1 then
    BOTy = low[round(cp/2)]
    BOTx = barindex[round(cp/2)]
    endif
    
    if LH>0 and (lastpoint=-1 or lastpoint=0) then
    DRAWSEGMENT(lastX,lastY,TOPx,TOPy) COLOURED(200,0,0,255)
    DRAWTEXT("■",TOPx,TOPy,Dialog,Bold,20) coloured(200,0,0,255)
    drawtext("#upvol#",TOPx,TOPy*1.005) coloured (0,0,210)
    lastpoint = 1
    lastX = TOPx
    lastY = TOPy
    if lh=0 then
    upvol=0
    downvol=0
    else
    downvol=downvol+round(volume/1000)
    endif
    endif
    if LL<0 and (lastpoint=1 or lastpoint=0) then
    DRAWSEGMENT(lastX,lastY,BOTx,BOTy) COLOURED(0,200,0,255)
    DRAWTEXT("■",BOTx,BOTy,Dialog,Bold,20) coloured(0,200,0,255)
    drawtext("#downvol#",BOTx,BOTy*0.995) coloured (250,0,0)
    lastpoint = -1
    lastX = BOTx
    lastY = BOTy
    if ll=0 then
    upvol=0
    downvol=0
    else
    
    upvol=upvol+round(volume/1000)
    endif
    endif
    RETURN
    TwilightD thanked this post
Viewing 15 posts - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.

Conversion of “PriceActionSwing” indicators package for NinjaTrader 7.0+8.0


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
anjoloro @anjoloro Participant
Summary

This topic contains 19 replies,
has 4 voices, and was last updated by anjoloro
4 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/06/2021
Status: Active
Attachments: 6 files
Logo Logo
Loading...