Login Page - Create Account

Support Board


Date/Time: Thu, 28 Mar 2024 12:12:30 +0000



[User Discussion] - SUPERTREND WITH HULL MOVING AVERAGE

View Count: 7317

[2015-02-09 17:15:57]
Carl71 - Posts: 125
Please add the Hull Moving Average to the SuperTrend Study

If you can, add also the EMA, Weighted MA, TRIPLE EXP MOV AVG (Tema), Volume Weighted Moving Average, Zero Lag Exponential Moving Average, Smoothed Moving Average (SMMA), the Variable Moving Average (Vidya).

The Hull MA is very good for the SuperTrend
imageSuperTrend HullMA.png / V - Attached On 2015-02-09 17:15:53 UTC - Size: 167.08 KB - 1931 views
[2015-02-10 17:19:21]
Carl71 - Posts: 125
I need this study with Hull Ma

Please add this moving average to the SuperTrend or tell me how can I do it
Date Time Of Last Edit: 2015-02-10 17:20:18
[2015-02-10 18:45:48]
ehlaban - Posts: 50
Is the SuperTrend study available in Sierra ?
[2015-02-11 13:18:37]
Carl71 - Posts: 125
What's wrong with that? I'have tried to replace SIMPLE with HULL in the formula but I am not able to create a .dll from .cpp
Can you give me this .dll?


_/*============================================================================
  SuperTrend Stop study function.
----------------------------------------------------------------------------*/
SCSFExport scsf_SuperTrendStop(SCStudyInterfaceRef sc)
{
  SCSubgraphRef Stop = sc.Subgraph[0];
  
  SCSubgraphRef Median = sc.Subgraph[1];

  SCFloatArrayRef TrueRange = Stop.Arrays[0];
  SCFloatArrayRef AvgTrueRange = Stop.Arrays[1];
  SCFloatArrayRef Trend = Stop.Arrays[2];


  SCInputRef ATRMultiplier = sc.Input[0];
  SCInputRef ATRPeriod = sc.Input[1];
  SCInputRef MedianPeriod = sc.Input[2];

  // Set configuration variables
  if (sc.SetDefaults)
  {
    // Set the configuration and defaults
    sc.GraphName = "SuperHullTrend Stop";
    
    sc.StudyDescription = "";
    sc.DrawZeros = false;
    sc.GraphRegion = 0;
    sc.ValueFormat = sc.BaseGraphValueFormat;
    
    //During development set this flag to 1, so the DLL can be modified. When development is completed, set it to 0 to improve performance.
    sc.FreeDLL = 0;
    
    sc.AutoLoop = 1;
    
    Stop.Name = "Stop";
    Stop.DrawStyle = DRAWSTYLE_DASH;
    Stop.LineWidth = 2;
    Stop.PrimaryColor = COLOR_CYAN;
    Stop.SecondaryColor = COLOR_RED;
    Stop.SecondaryColorUsed = 1;

    ATRMultiplier.Name = "ATR Multiplier";
    ATRMultiplier.SetFloat(2);
    ATRMultiplier.SetFloatLimits(0.000001f,(float)MAX_STUDY_LENGTH);
    
    ATRPeriod.Name = "ATR Period";
    ATRPeriod.SetInt(3);
    ATRPeriod.SetIntLimits(1,MAX_STUDY_LENGTH);
    
    MedianPeriod.Name = "Median Period";
    MedianPeriod.SetInt(3);
    MedianPeriod.SetIntLimits(1,MAX_STUDY_LENGTH);

    return;
  }
  
  // Do data processing
  sc.MovingMedian(sc.HLAvg, Median, sc.Index, MedianPeriod.GetInt());
  sc.ATR(sc.BaseDataIn, TrueRange, AvgTrueRange, sc.Index, ATRPeriod.GetInt(), MOVAVGTYPE_HULL);

  if (sc.Index == 0)
  {
    sc.ValueFormat = sc.BaseGraphValueFormat;

    Stop[sc.Index] = sc.Close[sc.Index];
    Trend[sc.Index] = 1;
    return;
  }

  if (sc.FormattedEvaluate(sc.Close[sc.Index], sc.ValueFormat, GREATER_OPERATOR, Stop[sc.Index-1], sc.ValueFormat))
  {
    Trend[sc.Index] = 1;
    float NewStop = Median[sc.Index] - ATRMultiplier.GetFloat()*AvgTrueRange[sc.Index-1];
    if (Trend[sc.Index-1] < 0)
    {
      Stop[sc.Index] = NewStop;
    }
    else
    {
      Stop[sc.Index] = max(NewStop, Stop[sc.Index-1]);
    }
  }
  else if (sc.FormattedEvaluate(sc.Close[sc.Index], sc.ValueFormat, LESS_OPERATOR, Stop[sc.Index-1], sc.ValueFormat))
  {
    Trend[sc.Index] = -1;
    float NewStop = Median[sc.Index] + ATRMultiplier.GetFloat()*AvgTrueRange[sc.Index-1];
    if (Trend[sc.Index-1] > 0)
    {
      Stop[sc.Index] = NewStop;
    }
    else
    {
      Stop[sc.Index] = min(NewStop, Stop[sc.Index-1]);
    }
  }
  else
  {
    Trend[sc.Index] = Trend[sc.Index-1];
    Stop[sc.Index] = Stop[sc.Index-1];
  }

  Stop.DataColor[sc.Index] = Trend[sc.Index] > 0 ? Stop.PrimaryColor : Stop.SecondaryColor;

}

Date Time Of Last Edit: 2015-02-11 13:20:59
[2015-02-11 18:01:36]
ehlaban - Posts: 50
I don't think MOVAVGTYPE_HULL is supported so it's not possible to implement.
[2015-02-11 19:24:12]
crazybears - Posts: 314
Hi

take a look here ,maybe you can use it as function

https://www.sierrachart.com/supportboard/showthread.php?t=20784
[2015-02-11 21:30:45]
Carl71 - Posts: 125
Is it really so difficult for some expert users to create the SuperTrend with Hull MA?
I am not familiar with these scripts
I am an older trader
I would be grateful if someone would work on this
Date Time Of Last Edit: 2015-02-11 21:32:58
[2019-08-06 20:33:39]
Ackin - Posts: 1863
Please add the Hull Moving Average to the SuperTrend Study

If you can, add also the EMA, Weighted MA, TRIPLE EXP MOV AVG (Tema), Volume Weighted Moving Average, Zero Lag Exponential Moving Average, Smoothed Moving Average (SMMA), the Variable Moving Average (Vidya).

The Hull MA is very good for the SuperTrend

I did a Super Trend study with adaptive MA for my customer yesterday. While I was creating it I also added another 12 kinds of moving averages (Hull, Adaptive, Dema....). If someone is asking for, it's possible to download modified study for free from our CZ/SK forum
(just Study in dll file, not code).


Study: Super trend - improved

contact link:
https://www.sierrachart.com/UserControlPanel.php?page=StudyStore&SCDLLName=zyp_download_free
Date Time Of Last Edit: 2020-06-24 22:34:52
[2021-06-06 11:41:36]
thafuz - Posts: 7
Thanks for this, Is it possible to add T3 (Tilson Moving Average)?
[2021-06-06 12:41:27]
Ackin - Posts: 1863
Thanks for this, Is it possible to add T3 (Tilson Moving Average)?

Yes, next update ...

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account