Login Page - Create Account

Support Board


Date/Time: Tue, 07 Apr 2020 06:53:58 +0000



[User Discussion] - SUPERTREND WITH HULL MOVING AVERAGE

[2015-02-09 17:15:57]
Carl71 - Posts: 125 | Ending Date: 2014-03-26 [Expired]
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 - 993 views
[2015-02-10 17:19:21]
Carl71 - Posts: 125 | Ending Date: 2014-03-26 [Expired]
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 | Ending Date: 2020-08-06
Is the SuperTrend study available in Sierra ?
[2015-02-11 13:18:37]
Carl71 - Posts: 125 | Ending Date: 2014-03-26 [Expired]
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 | Ending Date: 2020-08-06
I don't think MOVAVGTYPE_HULL is supported so it's not possible to implement.
[2015-02-11 19:24:12]
crazybears - Posts: 314 | Ending Date: 2016-02-26 [Expired]
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 | Ending Date: 2014-03-26 [Expired]
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: 693 | Ending Date: 2020-09-04
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


More information:
https://www.sierrachart.com/SupportBoard.php?ThreadID=20360#P187316
Date Time Of Last Edit: 2019-08-06 20:50:29

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

Login

Login Page - Create Account