Conversion of “PriceActionSwing” indicators package for NinjaTrader 7.0+8.0
Forums › ProRealTime English forum › ProBuilder support › Conversion of “PriceActionSwing” indicators package for NinjaTrader 7.0+8.0
- This topic has 19 replies, 4 voices, and was last updated 3 years ago by anjoloro.
-
-
05/06/2021 at 9:06 AM #168916
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=1781I 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
1 user thanked author for this post.
05/06/2021 at 11:00 AM #16893205/06/2021 at 2:17 PM #168944Yes, 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.
anjoloro1 user thanked author for this post.
05/06/2021 at 3:51 PM #168962That 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.
05/06/2021 at 5:50 PM #168965OK, 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.
anjoloro1 user thanked author for this post.
05/06/2021 at 10:29 PM #168986Hello 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.
anjoloroZigZag Cumulative Volume indicator - 06.05.2021 modified version123456789101112131415161718192021222324252627282930313233343536// 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.// ParameterspercentVariation = 9/22 // Adapted for a 5 MINUTES TIMEFRAME. percentVariation = 9 (aprox) for a 2 DAYS TIMEFRAMEzz = ZigZag[percentVariation](close)peak = (zz<zz[1]) and (zz[1]>zz[2])tough = (zz>zz[1]) and (zz[1]<zz[2])cumV = cumV + volume// Calculationsif peak thentext = 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 = Volumecolor = -1previousX = barindex[1]previousY = cumV[1]+0.20*cumV[1]elsif tough thentext = 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 = Volumecolor = 1previousX = barindex[1]previousY = cumV[1]+0.20*cumV[1]endif// Results plottingreturn cumV coloured by color05/07/2021 at 8:11 AM #169002Bonjour, 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 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.
anjoloro05/10/2021 at 11:42 AM #169259I have also found this, which can be useful:
https://www.prorealcode.com/prorealtime-indicators/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!05/10/2021 at 1:07 PM #169278I’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:
1234factor = 1.618 //whatever factora=cumsum(range)/barindex //average of candlesticks sizepercent=((a/close)*100)*factor // adjust a percentage variation05/11/2021 at 8:31 PM #169429Thanks, 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! 😉
1 user thanked author for this post.
05/12/2021 at 5:00 PM #16950305/12/2021 at 5:22 PM #16951105/13/2021 at 8:39 AM #169556Hello,
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 advice05/13/2021 at 8:43 AM #169558CCH_Weis Wave Volume Histogramme123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566//erreur sur texte cumul volume?//p=2defparam calculateonlastbars = 400trendDetectionLength=pif close>close[1] thenmov=1elsif close<close[1] thenmov=-1elsemov=0endifif mov <>0 and mov <> mov[1] thentrend=movelsetrend=trend[1]endifrising=abs(close-close[1])>=abs(close-close[trendDetectionLength])falling=abs(close-close[1]<abs(close-close[trendDetectionLength]))if rising or falling thenisTrending= rising or fallingendifif trend <> wave[1] and isTrending thenwave=trendelsewave=wave[1]endifif wave=wave[1] thenvol=vol[1]+volumeelsevol=volumeendifif wave=1 thenup=voldn=0elsif wave=-1 thenup=0dn=volelseup=0dn=volendifpeak = up<up[1] and up[1]>up[2]tough = dn<dn[1] and dn[1]>dn[2]cumV = cumV+volumeup=up+volumedn=dn+volumeif peak thentext = round(cumv/1000)drawtext("#text#K",barindex[1],up[1]+0.17*up[1],Dialog,Bold,12) coloured(0,200,0)cumV = upelsif tough thentext = round(cumv/1000)drawtext("#text#K",barindex[1],dn[1]+0.23*dn[1],Dialog,Bold,12) coloured(200,0,0)cumV = dnendifreturn up coloured (0,128,0)style(histogram)as "up",dn coloured(255,0,0)style(histogram)as "dn"05/13/2021 at 8:49 AM #169559CCH-ZIGZAG Fractal Wave Volume12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758//Erreur sur valeur texte cumulée volume//---external parameters//cp = 20defparam calculateonlastbars = 400once lastpoint = 0if high[round(cp/2)] >= highest[round(cp+1)](high) thenLH = 1elseLH = 0endifif low[round(cp/2)] <= lowest[round(cp+1)](low) thenLL = -1elseLL = 0endifif LH = 1 thenTOPy = high[round(cp/2)]TOPx = barindex[round(cp/2)]endifif LL = -1 thenBOTy = low[round(cp/2)]BOTx = barindex[round(cp/2)]endifif LH>0 and (lastpoint=-1 or lastpoint=0) thenDRAWSEGMENT(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 = 1lastX = TOPxlastY = TOPyif lh=0 thenupvol=0downvol=0elsedownvol=downvol+round(volume/1000)endifendifif LL<0 and (lastpoint=1 or lastpoint=0) thenDRAWSEGMENT(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 = -1lastX = BOTxlastY = BOTyif ll=0 thenupvol=0downvol=0elseupvol=upvol+round(volume/1000)endifendifRETURN1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on