Hull MA-X + Ichimoku Kinko Hyo Strategy
Forums › ProRealTime English forum › ProOrder support › Hull MA-X + Ichimoku Kinko Hyo Strategy
- This topic has 3 replies, 3 voices, and was last updated 5 years ago by
Scooby.
-
-
04/28/2020 at 9:58 AM #128570
Hey guys,
I found this strategy on Tradingview that has been working quite well for manual trading. I know I’m asking for much but it would be nice to see how this could perform as an automated system. It is doing really well in the backtests on tradingview.
I lack the coding skills to convert this myself but I believe this has the probabilities to work really well as an automated system. So if anyone out there could coach me or help me translate this into PRT-code I would be really happy.Info regarding the strategy
The Hull MA involves the weighted moving average ( WMA ) in its calculation.
First, calculate the WMA with period (n / 2) and multiply this by 2. Remember ‘n’ is the time period configurable based on the trader’s requirement.
Second, calculate the WMA for period “n” and subtract if from the first step. Thirdly, calculate the weighted moving average with period sqrt (n) using the data from the second step. You can take a look at the below formula:
Hull MA= WMA (2*WMA (n/2) − WMA (n)), sqrt (n))
The default setting is 12 periods in this strategy, fast Hull MA crossing slow Hull MA will generate a circle on charts.
Ichimoku Kinko Hyo:
The Ichimoku Kinko Hyo system includes five kinds of signal, of which this strategy uses four signals i.e. Tenkan Sen / Kijun Sen Cross, price crosses the Kijun Sen, Chikou Span and Kumo. Although the Chikou Span, Senkou Span A and Senkou Span B (Kumo) are shifted into the past/future, these trigger signals enhances the strategy.The Tenkan Sen, also known as the Turning or Conversion line, is a moving average of the highest high and lowest low over the last 9 periods in this strategy.
The Kijun Sen, also known as the Standard or Base line, is a moving average of the highest high and lowest low over the last 24 periods in this strategy.
The Chikou Span, also known as the Lagging line, is the closing price plotted 24 periods behind in this strategy.
The Senkou Span A, also known as the 1st leading line, is a moving average of the Tenkan Sen and Kijun Sen and is plotted 24 periods ahead in this strategy.
The Senkou Span B, also known as the 2nd leading line, is a moving average of the highest high and lowest low over the last 51 trading days is plotted 24 periods ahead in this strategy.
As with most technical analysis methods, Ichimoku is likely to produce frequent conflicting signals in non-trending markets, So in addition to Ichimoku Kinko Hyo, the Hull MA is used, which is popular amongst some day traders, in combination it attempts to give an accurate signal by eliminating lags and improving the smoothness of the line.
The Hull MA Cross in combination with Ichimoku Kinko Hyo signals tries to give an accurate signal by eliminating lags and improve the smoothness of price activity. Please note that price trends can and do change often, so your readings of the charts and this trading system should be probabilistic, rather than predictive.
Hull MA-X + Ichimoku Kinko Hyo Strategy12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758//@version=3strategy("Hull MA_X + Ichimoku Kinko Hyo Strategy", shorttitle="Hi", overlay=true, default_qty_type=strategy.percent_of_equity, max_bars_back=1000, default_qty_value=100, calc_on_order_fills= true, calc_on_every_tick=true, pyramiding=0)keh=input(title="Double HullMA",type=integer,defval=12, minval=1)n2ma=2*wma(close,round(keh/2))nma=wma(close,keh)diff=n2ma-nmasqn=round(sqrt(keh))n2ma1=2*wma(close[1],round(keh/2))nma1=wma(close[1],keh)diff1=n2ma1-nma1sqn1=round(sqrt(keh))n1=wma(diff,sqn)n2=wma(diff1,sqn)b=n1>n2?lime:redc=n1>n2?green:redd=n1>n2?red:greenTenkanSenPeriods = input(9, minval=1, title="Tenkan Sen Periods")KijunSenPeriods = input(24, minval=1, title="Kijun Sen Periods")SenkouSpanBPeriods = input(51, minval=1, title="Senkou Span B Periods")displacement = input(24, minval=1, title="Displacement")donchian(len) => avg(lowest(len), highest(len))TenkanSen = donchian(TenkanSenPeriods)KijunSen = donchian(KijunSenPeriods)SenkouSpanA = avg(TenkanSen, KijunSen)SenkouSpanB = donchian(SenkouSpanBPeriods)SenkouSpanH = max(SenkouSpanA[displacement - 1], SenkouSpanB[displacement - 1])SenkouSpanL = min(SenkouSpanA[displacement - 1], SenkouSpanB[displacement - 1])ChikouSpan = close[displacement-1]Hullfast=plot(n1,color=c)Hullslow=plot(n2,color=c)plot(cross(n1, n2) ? n1:na, style = circles, color=b, linewidth = 4)plot(cross(n1, n2) ? n1:na, style = line, color=d, linewidth = 3)plot(TenkanSen, color=blue, title="Tenkan Sen", linewidth = 2)plot(KijunSen, color=maroon, title="Kijun Sen", linewidth = 3)plot(close, offset = -displacement, color=orange, title="Chikou Span", linewidth = 2)sa=plot (SenkouSpanA, offset = displacement, color=green, title="Senkou Span A", linewidth = 2)sb=plot (SenkouSpanB, offset = displacement, color=red, title="Senkou Span B", linewidth = 3)fill(sa, sb, color = SenkouSpanA > SenkouSpanB ? green : red)longCondition = n1>n2 and close>n2 and close>ChikouSpan and close>SenkouSpanH and (TenkanSen>=KijunSen or close>KijunSen)if (longCondition)strategy.entry("Long",strategy.long)shortCondition = n1<n2 and close<n2 and close<ChikouSpan and close<SenkouSpanL and (TenkanSen<=KijunSen or close<KijunSen)if (shortCondition)strategy.entry("Short",strategy.short)closelong = n1<n2 and (close<n2 or TenkanSen<KijunSen or close<TenkanSen or close<KijunSen or close<SenkouSpanH or close<ChikouSpan)if (closelong)strategy.close("Long")closeshort = n1>n2 and (close>n2 or TenkanSen>KijunSen or close>TenkanSen or close>KijunSen or close>SenkouSpanL or close>ChikouSpan)if (closeshort)strategy.close("Short")1 user thanked author for this post.
04/28/2020 at 10:29 AM #128580You have to ask here for the conversion https://www.prorealcode.com/free-code-conversion/
04/28/2020 at 10:34 AM #128581Hull MA12345678910defparam cumulateorders=false//HullMA, the Hull Moving Average:Period = 14Data = Closeinner = 2*weightedaverage[round(Period/2)](Data)-weightedaverage[Period](Data)S = weightedaverage[round(sqrt(Period))](inner)newuptrend = S[2]>S[1] and S>S[1]newdowntrend = S[2]<S[1] and S<S[1]This is the code from Nicolas on this website 🙂
04/28/2020 at 11:15 AM #128589V1 ?1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859//-------------------------------------------------------------------------// Code principal : DEV - DAX M5 - ICHIMOKU//-------------------------------------------------------------------------DEFPARAM CumulateOrders = falseDEFPARAM Preloadbars = 3000// TAILLE DES POSITIONSn = 3// HORAIRES DE TRADING//TimeAchat = time >= 080500 and time < 152500//TimeVente = time >= 080500 and time < 152500//@version=3Period = 12diff = 2*weightedaverage[round(Period/2)](Close)-weightedaverage[Period](Close)diff2 = 2*weightedaverage[round(Period/2)](Close[1])-weightedaverage[Period](Close[1])n1 = weightedaverage[round(sqrt(Period))](diff)n2 = weightedaverage[round(sqrt(Period))](diff2)graphonprice n1graphonprice n2TenkanSenPeriods = 9KijunSenPeriods = 24SenkouSpanBPeriods = 5displacement = 24Tenkansen = (highest[TenkanSenPeriods](high)+lowest[TenkanSenPeriods](low))/2KijunSen = (highest[KijunSenPeriods](high)+lowest[KijunSenPeriods](low))/2SenkouSpanA = (tenkansen[SenkouSpanBPeriods]+kijunsen[SenkouSpanBPeriods])/2SenkouSpanB = (highest[SenkouSpanBPeriods*2](high[SenkouSpanBPeriods])+lowest[SenkouSpanBPeriods*2](low[SenkouSpanBPeriods]))/2SenkouSpanH = max(SenkouSpanA[displacement - 1], SenkouSpanB[displacement - 1])SenkouSpanL = min(SenkouSpanA[displacement - 1], SenkouSpanB[displacement - 1])ChikouSpan = close[displacement-1]longCondition = n1>n2 and close>n2 and close>ChikouSpan and close>SenkouSpanH and (TenkanSen>=KijunSen or close>KijunSen)if (longCondition) thenbuy n contract at marketendifshortCondition = n1<n2 and close<n2 and close<ChikouSpan and close<SenkouSpanL and (TenkanSen<=KijunSen or close<KijunSen)if (shortCondition) thensellshort n contract at marketendifcloselong = n1<n2 and (close<n2 or TenkanSen<KijunSen or close<TenkanSen or close<KijunSen or close<SenkouSpanH or close<ChikouSpan)if (closelong) thensell at marketendifcloseshort = n1>n2 and (close>n2 or TenkanSen>KijunSen or close>TenkanSen or close>KijunSen or close>SenkouSpanL or close>ChikouSpan)if (closeshort) thenexitshort at marketendif@MonopolyTm let’s take a look on this code, this does’nt provide good results currently (tested on daily / 15 min). I did certainly a mistake 🙂
On which timeframe did you work with this algo ?
On which market ?
-
AuthorPosts
Find exclusive trading pro-tools on