Hull MA-X + Ichimoku Kinko Hyo Strategy

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #128570 quote
    MonopolyTm
    Participant
    Average

    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.

     

    //@version=3
    
    strategy("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-nma
    sqn=round(sqrt(keh))
    n2ma1=2*wma(close[1],round(keh/2))
    nma1=wma(close[1],keh)
    diff1=n2ma1-nma1
    sqn1=round(sqrt(keh))
    n1=wma(diff,sqn)
    n2=wma(diff1,sqn)
    b=n1>n2?lime:red
    c=n1>n2?green:red
    d=n1>n2?red:green
    
    TenkanSenPeriods = 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")
    Boris thanked this post
    Hull-MA_X-ichimoku-hyo-strategy.jpg Hull-MA_X-ichimoku-hyo-strategy.jpg
    #128580 quote
    Francesco
    Participant
    Veteran

    You have to ask here for the conversion https://www.prorealcode.com/free-code-conversion/

    #128581 quote
    Scooby
    Participant
    Senior
    defparam cumulateorders=false
     
    //HullMA, the Hull Moving Average:
    Period = 14
    Data = Close
    inner = 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 🙂

    #128589 quote
    Scooby
    Participant
    Senior
    //-------------------------------------------------------------------------
    // Code principal : DEV - DAX M5 - ICHIMOKU
    //-------------------------------------------------------------------------
    DEFPARAM CumulateOrders = false
    DEFPARAM Preloadbars = 3000
    
    // TAILLE DES POSITIONS
    
    n = 3
    
    // HORAIRES DE TRADING
    //TimeAchat = time >= 080500 and time < 152500
    //TimeVente = time >= 080500 and time < 152500
    
    //@version=3
     
    Period = 12
    
    diff = 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 n1
    graphonprice n2
    
    TenkanSenPeriods = 9
    KijunSenPeriods = 24
    SenkouSpanBPeriods = 5
    displacement = 24
    
    Tenkansen = (highest[TenkanSenPeriods](high)+lowest[TenkanSenPeriods](low))/2
    KijunSen = (highest[KijunSenPeriods](high)+lowest[KijunSenPeriods](low))/2
    SenkouSpanA = (tenkansen[SenkouSpanBPeriods]+kijunsen[SenkouSpanBPeriods])/2
    SenkouSpanB = (highest[SenkouSpanBPeriods*2](high[SenkouSpanBPeriods])+lowest[SenkouSpanBPeriods*2](low[SenkouSpanBPeriods]))/2
    SenkouSpanH = 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) then
    buy n contract at market
    endif
     
    shortCondition = n1<n2 and close<n2 and close<ChikouSpan and close<SenkouSpanL and (TenkanSen<=KijunSen or close<KijunSen)
    if (shortCondition) then
    sellshort n contract at market
    endif
     
    closelong = n1<n2 and (close<n2 or TenkanSen<KijunSen or close<TenkanSen or close<KijunSen or close<SenkouSpanH or close<ChikouSpan)
    if (closelong) then
    sell at market
    endif
     
    closeshort = n1>n2 and (close>n2 or TenkanSen>KijunSen or close>TenkanSen or close>KijunSen or close>SenkouSpanL or close>ChikouSpan)
    if (closeshort) then
    exitshort at market
    endif
    

    @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 ?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Hull MA-X + Ichimoku Kinko Hyo Strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
MonopolyTm @monopolytm Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by Scooby
5 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/28/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...