Heiken Ashi smoothed
Forums › ProRealTime English forum › ProBuilder support › Heiken Ashi smoothed
- This topic has 5 replies, 2 voices, and was last updated 8 years ago by Nicolas.
-
-
11/30/2016 at 2:54 PM #17559
Hi there!
I´m a newbie and this is my first indicator query 🙂
I found this in the web, but it doesen´t work in this state, its giving syntax error and I don´t have the skill yet to correct it.
Could someone have mercy with me? I think it is a quite simple error..This is the link, it´s in french.
http://sohocool.over-blog.com/article-29022036.htmlHere is the code: Syntax error line 28, 30
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788/// Heiken ashi smoothed histogram// Average variable p = 1 period (default = 6) and t = mm Type (default smoothing wilder)// Average variable 2 p1 = period (default = 2) and t1 = mm type (weighted default){// t and the deviation of the mean:t = 0 = simple averaget = 1 = exponential averaget = 2 weighted average =t = 3 = average wildert = 4 = average triangulart = 5 = average end-pointt = 6 = average time series}// set histogrammmeif BarIndex> p Thenmo = average [p, t] (open)mc = average [p, t] (close)ml = average [p, t] (low)mh = average [p, t] (high)endifhaopen ounce = mohaclose = (mc mo + + + mh ml) / 4if BarIndex> p + 1 thenhaopen = (haopen [1] + haclose [1]) / 2endifhaopen1 average = [p1, t1] (haopen)haclose1 average = [p1, t1] (haclose)if haclose1> haopen1 Thena = 1elsea = -1endifreturn 1 colored by aa as "Smoothed Heiken Histo"///////// endcloud code to open in the graph:/// Heiken ashi smoothed histogram// Average variable p = 1 period (default = 6) and t = mm Type (default smoothing wilder)// Average variable 2 p1 = period (default = 2) and t1 = mm type (weighted default){t and the deviation of the mean:t = 0 = simple averaget = 1 = exponential averaget = 2 = weighted averaget = 3 = average wildert = 4 = average triandulairet = 5 = average end-pointt = 6 = average time series}if BarIndex> p Thenmo = average [p, t] (open)mc = average [p, t] (close)ml = average [p, t] (low)mh = average [p, t] (high)endifhaopen ounce = mohaclose = (mc mo + + + mh ml) / 4if BarIndex> p + 1 thenhaopen = (haopen [1] + haclose [1]) / 2endifhaopen1 average = [p1, t1] (haopen)haclose1 average = [p1, t1] (haclose)haopen1 return as "Smoothed Heiken Nuageopen" haclose1 as "Smoothed Heiken nuageclose"///////end11/30/2016 at 3:04 PM #1756311/30/2016 at 4:12 PM #17584Thanks a lot Nicholas, very kind of you!
I also found this indicator on your eminent website, but it seemes only to work in 10.3 and I have 10.2..?
Is it possible to have a beta PRT10.3 working in the IG-world or do we have to wait for the official one? Have you heard anything about when?
I would love to get my hands on it and get rid of the inside-bar problem when backtesting.http://www.prorealcode.com/documentation/drawbarchart/
1234567891011121314151617181920212223242526//Smooth Heiken Ashi barchartperiod = 20if barindex>period thenavgO = average[period](open)avgH = average[period](high)avgL = average[period](low)avgC = average[period](close)HAClose = (avgO+avgH+avgL+avgC) /4HAOpen = (HAOpen[1]+HAClose[1]) / 2HAHigh = MAX(avgH,MAX(HAOpen,HAClose))HALow = MIN(avgL,MIN(HAOpen,HAClose))IF avgO <= avgC THEN// Green candlestickDRAWBARCHART(HAOpen,HAHigh,HALow,HAClose) COLOURED(0,255,0)ELSE// Red candlestickDRAWBARCHART(HAOpen,HAHigh,HALow,HAClose) COLOURED(255,0,0)ENDIFendifRETURN11/30/2016 at 4:30 PM #1758811/30/2016 at 6:54 PM #1760311/30/2016 at 8:03 PM #17614 -
AuthorPosts