Heiken Ashi Smoothed Code
Forums › ProRealTime English forum › ProBuilder support › Heiken Ashi Smoothed Code
- This topic has 8 replies, 3 voices, and was last updated 7 years ago by Attienel.
-
-
08/07/2017 at 9:03 AM #42631
Hi there. Thank you for the code that was posted on this website on 25 Apr 2017 to plot the Heiken Ashi Smoothed indicator. I however noticed that down candles don’t display wicks at the bottom of the candle bodies, for all time frames, for all the stocks that I trade. Is this normal? Please see attached. Thank you, Attie
08/16/2017 at 8:02 AM #4323808/16/2017 at 10:37 AM #43243You can find another version of the Heikin Ashi Smoothed candlesticks in this Italian topic: https://www.prorealcode.com/topic/heikin-ashi-smoothed-candle/
and there are also many other topics that deal with this kind of price representation in the forums, you’ll find them easily by using the website search engine (sometimes people wrote “heiken” instead of “heikin”).
08/16/2017 at 12:49 PM #43266Hi Nicolas, thank you for your response.
I could not find any references on the site to double-smoothed Heiken indicators. The double smoothed indicator which you created for PRT is an amazing indicator as it really reduces a lot of noise. I have asked the programming team to investigate and give me a quote to see why the downtrend doesn’t form any wicks to the bottom. If I get a solution, I will share it with the forum. Thanks
08/16/2017 at 1:09 PM #4326708/16/2017 at 1:16 PM #4327108/16/2017 at 2:10 PM #43278>> Please use the “insert code PRT” button to add code in a PRT formatted and line-numbered style rather than .doc attachment, thank you! <<
The “if (haOpen<haClose)” statement assigning colors to smoothed HA candles seem also to switch highs and lows in extmapbuffer7 and extmapbuffer8, don’t see why they should be switched… switching high and low for red candle compared with blue/green candle give trouble drawing the red candles…
Both ExtMapBuffer7 lines should be = HALow , and both ExtMapBuffer8 lines should be = HAHigh (…and so could be taken out of the if-endif statement and be written just once rather than twice)
08/16/2017 at 2:29 PM #43280Had to try it, drawing correctly highs and lows has knock on effect of messing with long and short signal at the very end. Don’t know what the original code was before translation or if there was any explanation going with it, but it seems either there’s further debugging to do in long/short signals, or the swap of HAhigh and HAlow was intentional by the author at the expense of candle drawing accuracy, and shouldn’t be fixed in the first place in order to generate the long/short signals via these intermediate extmapbuffer7 and 8 variables
08/17/2017 at 8:37 AM #43322Hi Noobywan, I amended the code in line with your suggestion and it works perfectly for my purpose. Thank you very much for coming to my rescue. Attached is the revised code.
Happy trading
Attie
Heiken Ashi Double Smoothed1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253//PRC_HPT Heikin Ashi Smoothed | indicator//25.04.2017//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//translated from MT4 indicator code//---settingsMaPeriod=6MaPeriod2=2//---end of settingsonce maOpen=Openonce maClose=Closeonce maLow=Lowonce maHigh=Highif barindex>0 thenmaOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriodmaClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriodmaLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriodmaHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriodhaOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2haClose=(maOpen+maHigh+maLow+maClose)/4haHigh=Max(maHigh, Max(haOpen, haClose))haLow=Min(maLow, Min(haOpen, haClose))if (haOpen<haClose) thenr=0g=191b=255ExtMapBuffer7=haLowExtMapBuffer8=haHighelser=255g=10b=0ExtMapBuffer7=haLowExtMapBuffer8=haHighendifExtMapBuffer5=haOpenExtMapBuffer6=haCloseExtMapBuffer1=weightedaverage[MAperiod2](ExtMapBuffer7)ExtMapBuffer2=weightedaverage[MAperiod2](ExtMapBuffer8)ExtMapBuffer3=weightedaverage[MAperiod2](ExtMapBuffer5)ExtMapBuffer4=weightedaverage[MAperiod2](ExtMapBuffer6)endifDRAWCANDLE(ExtMapBuffer3,ExtMapBuffer2,ExtMapBuffer1,ExtMapBuffer4) coloured(r,g,b)short = ExtMapBuffer7[1]>ExtMapBuffer8[1] and ExtMapBuffer7[2]<ExtMapBuffer8[2] and ExtMapBuffer7[0]>ExtMapBuffer8[0]long = ExtMapBuffer7[1]<ExtMapBuffer8[1] and ExtMapBuffer7[2]>ExtMapBuffer8[2] and ExtMapBuffer7[0]<ExtMapBuffer8[0]RETURN long as "long signal", short as "short signal"1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on