CTRADER HULL MOVING AVERAGE

  • The Hull Moving Average (HMA), developed by Alan Hull, is an extremely fast and smooth Moving Average that almost eliminates lag altogether and manages to improve smoothing at the same time


     


    This indicator is an extension to the Hull Moving Average where it shows optional signals for trend:-



    • Optional Arrows on chart where trend changes

    • Optional Text on chart displaying trend direction

    • Optional display of HULL line, only display trend description.

    • Set how far away the arrow is spaced from the HMA with different time-frames.

    • Two public properties for usage with cBots


     



     


    Parameters



     


    Usage with cBots


    If you reference this indicator from your cBot you can use the IsBullish and IsBearish properties to determine an additional signal to help you buy or sell.


    This is best for daily trends, but you can change the time-frame in your cBot code.


    declare private variable's


    private MarketSeries HmaDaySeries;
    private HMASignals hmaSignal;

     


    In the OnStart method construct your timeframe


    HmaDaySeries = MarketData.GetSeries(TimeFrame.Daily);

     


    Also in your OnStart method create your hmaSignal object.


    hmaSignal = Indicators.GetIndicator(HmaDaySeries, 21, false, false, 3, false, 24);

     


    Now use this as follows in your robots.


    // forces loading hma object with values
    double i = hmaSignal.hma.LastValue;

    // If HMA daily trend is active then only trade where the signals are buy or sell
    if (hmaSignal.IsBullish)
    {
    // Only BUY
    }

    if (hmaSignal.IsBearish)
    {
    // Only SELL
    }
198 views
0 comments