Hull Suite Gael

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #175942 quote
    GaelGael
    Participant
    Average

    Avrei un grande favore da chiedervi, ovvero quello di tradurre un indicatore che ho trovato in un trading System.

    L’indicatore si può trovare su Tradingview e si chiama: Hull Suite by InSilico

    La strategia è molto semplice e sarebbe la seguente: long quando la fascia diventa verde e si chiude la posizione appena diventa rossa e viceversa con il short

    Vi lascio in allegato delle immagini per capire meglio.

    rimango a vostra disposizione per eventuali domande e vi ringrazio in anticipo

    Q9OQye4C_big.png Q9OQye4C_big.png Hull-Suite-Strategy.png Hull-Suite-Strategy.png C1kLh8FY.png C1kLh8FY.png
    #175959 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Posta il codice ed il link.

    #175972 quote
    GaelGael
    Participant
    Average

     

    https://alanhull.com/hull-moving-average

     

     

     

    //@version=4
    //Basic Hull Ma Pack tinkered by InSilico
    study(“Hull Suite by InSilico”, overlay=true)

    //INPUT
    src = input(close, title=”Source”)
    modeSwitch = input(“Hma”, title=”Hull Variation”, options=[“Hma”, “Thma”, “Ehma”])
    length = input(55, title=”Length(180-200 for floating S/R , 55 for swing entry)”)
    lengthMult = input(1.0, title=”Length multiplier (Used to view higher timeframes with straight band)”)

    useHtf = input(false, title=”Show Hull MA from X timeframe? (good for scalping)”)
    htf = input(“240″, title=”Higher timeframe”, type=input.resolution)

    switchColor = input(true, “Color Hull according to trend?”)
    candleCol = input(false,title=”Color candles based on Hull’s Trend?”)
    visualSwitch = input(true, title=”Show as a Band?”)
    thicknesSwitch = input(1, title=”Line Thickness”)
    transpSwitch = input(40, title=”Band Transparency”,step=5)

    //FUNCTIONS
    //HMA
    HMA(_src, _length) => wma(2 * wma(_src, _length / 2) – wma(_src, _length), round(sqrt(_length)))
    //EHMA
    EHMA(_src, _length) => ema(2 * ema(_src, _length / 2) – ema(_src, _length), round(sqrt(_length)))
    //THMA
    THMA(_src, _length) => wma(wma(_src,_length / 3) * 3 – wma(_src, _length / 2) – wma(_src, _length), _length)

    //SWITCH
    Mode(modeSwitch, src, len) =>
    modeSwitch == “Hma” ? HMA(src, len) :
    modeSwitch == “Ehma” ? EHMA(src, len) :
    modeSwitch == “Thma” ? THMA(src, len/2) : na

    //OUT
    _hull = Mode(modeSwitch, src, int(length * lengthMult))
    HULL = useHtf ? security(syminfo.ticker, htf, _hull) : _hull
    MHULL = HULL[0]
    SHULL = HULL[2]

    //COLOR
    hullColor = switchColor ? (HULL > HULL[2] ? #00ff00 : #ff0000) : #ff9800

    //PLOT
    ///< Frame
    Fi1 = plot(MHULL, title=”MHULL”, color=hullColor, linewidth=thicknesSwitch, transp=50)
    Fi2 = plot(visualSwitch ? SHULL : na, title=”SHULL”, color=hullColor, linewidth=thicknesSwitch, transp=50)
    ///< Ending Filler
    fill(Fi1, Fi2, title=”Band Filler”, color=hullColor, transp=transpSwitch)
    ///BARCOLOR
    barcolor(color = candleCol ? (switchColor ? hullColor : na) : na)

    #176102 quote
    GaelGael
    Participant
    Average

    Hull Moving Average (HMA) formula

    Integer(SquareRoot(Period)) WMA [2 x Integer(Period/2) WMA(Price) – Period WMA(Price)]

     

    questa è la formula

    #176105 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Se è solo la media mobile e non una conversionedi una strategia, cercando HULL trovi molti link che la contengono, tra questi: https://www.prorealcode.com/prorealtime-indicators/hull-moving-average/

    Ma tu vuoi un indicatore o una strategia?

    #176257 quote
    GaelGael
    Participant
    Average

    una strategia

    #176282 quote
    NicolasNicolas
    Keymaster
    Legend

    Questo indicatore sta tracciando 2 volte la stessa media mobile dello scafo di X periodi. Il primo è lo scafo del periodo attuale e il secondo è lo scafo di 2 candele fa. Quindi puoi ottenere la stessa cosa con l'Hull MA predefinito dalla piattaforma.

    hull-ma-horizontal-shift.png hull-ma-horizontal-shift.png
    #176363 quote
    GaelGael
    Participant
    Average

    Grazie mille Nicolas.

    Posso chiedervi di crearmi un trading System con la moving average Hull che vende quando la media a 55 periodi con horizontal shift 2 supera la media a 55 periodi con Horizontal shift 0, mentre il contrario per l’acquisto.

    Ve ne sarei grato.

    Buona giornata

    #176370 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Come puoi vedere nell’immagine allegata, lo spostamento (in questo caso di 5 periodi perché è più evidente), significa che ADESSO tu prendi in considerazione il valore che la media aveva 5 periodi FA.

    Eccola:

    ONCE Periodi     = 55
    ONCE Shift       = 2
    Hull55shifhted   = average[Periodi,7](close[Shift])
    Hull55           = average[Periodi,7](close)
    //Hull55shifhted = hullaverage[Periodi](close[Shift])
    //Hull55         = hullaverage[Periodi](close)
    Lcond            = Hull55shifhted CROSSES UNDER Hull55
    Scond            = Hull55shifhted CROSSES OVER  Hull55
    IF Lcond AND Not LongOnMarket  THEN
       BUY 1 Contract AT Market
    ELSIF Scond AND Not ShortOnMarket THEN
       SELLSHORT 1 Contract AT Market
    ENDIF

    ho utilizzato la forma con AVERAGE, invece della HULLAVERAGE, in modo che sia più semplice cambiarla sostituendo 7 con un altro valore (tra 0 e 8). Se preferisci il contrario, togli i commenti dalla righe 5 e 6 e mettili alle righe 3 e 4 (in questo caso le righe 3 e 4 potresti anche toglierle).

    GraHal thanked this post
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Hull Suite Gael


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Gael @gael Participant
Summary

This topic contains 8 replies,
has 3 voices, and was last updated by robertogozzirobertogozzi
5 years, 1 month ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 08/22/2021
Status: Active
Attachments: 4 files
ProRealCode ProRealCode
Loading...