NexusFi: Find Your Edge


Home Menu

 





Step MA


Discussion in Sierra Chart

Updated
      Top Posters
    1. looks_one crazybears with 2 posts (0 thanks)
    2. looks_two josh with 1 posts (0 thanks)
    3. looks_3 Oltreoceano with 1 posts (0 thanks)
    4. looks_4 Nicolaas with 1 posts (0 thanks)
    1. trending_up 3,255 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 4 attachments




 
Search this Thread

Step MA

  #1 (permalink)
 crazybears 
Alesia E.U.
 
Experience: Intermediate
Platform: Sierra chart
Trading: Futures
Posts: 168 since Feb 2011
Thanks Given: 146
Thanks Received: 115

Hi


i'm looking to code it for SC but i'm not able to reproduce it.
Has someone already code it and willing to share

thanks

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
What broker to use for trading palladium futures
Commodities
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
REcommedations for programming help
Sierra Chart
 
  #2 (permalink)
 
josh's Avatar
 josh 
Georgia, US
Legendary Market Wizard
 
Experience: None
Platform: SC
Broker: Denali+Rithmic
Trading: ES, NQ, YM
Posts: 6,246 since Jan 2011
Thanks Given: 6,784
Thanks Received: 18,257


crazybears View Post
Hi


i'm looking to code it for SC but i'm not able to reproduce it.
Has someone already code it and willing to share

thanks

You have the logic for it? If so, post that, and what you have already tried to code.

Reply With Quote
  #3 (permalink)
 crazybears 
Alesia E.U.
 
Experience: Intermediate
Platform: Sierra chart
Trading: Futures
Posts: 168 since Feb 2011
Thanks Given: 146
Thanks Received: 115


Hi Josh

here the codes i tried to copy and my code.

my code it's just a draft , sorry it's not clean.

thanks

Attached Files
Elite Membership required to download: StepMA_v7.2.cs
Elite Membership required to download: stepMA.afl
Elite Membership required to download: StepMA_v7.mq4
Elite Membership required to download: StepMa.cpp
Started this thread Reply With Quote
  #4 (permalink)
Nicolaas
Utrecht+Utrecht/ The netherlands
 
Posts: 11 since Apr 2015
Thanks Given: 7
Thanks Received: 12

Hi,
I tried the Step Ma (Compiled the cpp file to dll), but I can't even get close to what it should look like, the inputs are also not working :-( Not sure why..

Reply With Quote
  #5 (permalink)
 
Oltreoceano's Avatar
 Oltreoceano 
Perth Australia
 
Experience: Intermediate
Platform: NinjaTrader, Sierra Chart
Broker: Kinetick
Trading: oil & gold
Posts: 13 since Jan 2013
Thanks Given: 6
Thanks Received: 9


josh View Post
You have the logic for it? If so, post that, and what you have already tried to code.

Hi guys,

It would be great if someone can recode the StepMA that TheWizard has coded. That is perfect..

Here is the code for NT-- I am not sure how to change it to SierraChart


#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion
#region enums

public enum MAAverageType
{
WMA,
SMA,
EMA,
}

#endregion

/**********************************************************************/
/* CHANGE LOG */
/* 09-11-08 mrLogik */
/* - Initial Release */
/* 09-12-08 mrLogik */
/* - Changed MA_MODE SMA option to MA / Weighted */
/* 09-12-08 whitegun */
/* - Allow kV Input minimum value to be 0 rather than 1 */
/* - Allow Percentage Input to be positive or negative */
/* -12-11-09 Zondor use multiple colored single plot for NT7 */
/* September 8, 2013 TheWizard */
/* - added ColorMode "3" to allow for coloring the line based on */
/* open and close being above or below the line. If both open */
/* and close of current bar are above the line, color the line */
/* the selected UP color. If both open and close of current bar */
/* are below the line, color the line the selected DOWN color. */
/* else, color the line the selected NEUTRAL color. Also added */
/* the option to color the price bars based on the color of the */
/* SetpMA line. */
/**********************************************************************/

// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
[Description("Enter the description of your new custom indicator here")]
public class StepMaV72Sharky : Indicator
{
//Inputs
private int lastbar,startbar,lastcalcbar;
private int lastBar,firstBar,b;
private double trunc;
private bool Treasury;
// private string priceMarker; // commented out by Silvester17 to decrease right price margin Feb 26, 2014
private string Nn;
private double hValue=0;
private int fraction;
private decimal fractional;
private int plot0Width = 2;
private PlotStyle plot0Style = PlotStyle.Line;
private DashStyle dash0Style = DashStyle.Solid;

private Color downColor = Color.Red;
private Color upColor = Color.CornflowerBlue;
private Color neutralColor = Color.White;
private Color prevcolor = Color.Yellow;
private double buffer;

private int iLength = 10; // Moving Average Length
private int iStepSize = 11; // Constant StepSize (if needed)
private int iTenthPip = 2; // MBT Users should set this to 10 for (1/10)th Pip Granularity
private MAAverageType iAverageType = MAAverageType.WMA; // Moving Average Type
double iKv = 0.4; // Sensivity Factor
double iPercentage = 0; // Percentage of Up/Down Moving
bool iHighLow = true; // High/Low Mode Switch (more sensitive)
int iColorMode = 2; // Color Mode Switch

// Variables
private double vATR0 = 0;
private double vATRmax = -100000;
private double vATRmin = 1000000;

//Data Series'
private DataSeries sUp;
private DataSeries sDn;
private DataSeries sSMax;
private DataSeries sSMin;
private DataSeries sTrend;
private int precision=0;
private DataSeries main;
private string precisionstring="";
private string zerostring="0000000000";
private int lastrefreshbar=0;
private bool init=false;
private bool colorbars = false;
private bool arrows = false;
private bool uparrowdrawn=false;
private bool dnarrowdrawn=false;


/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
this.Name = "Step MA V72";

Add(new Plot(Color.FromKnownColor(KnownColor.Yellow), PlotStyle.Line, "MultiColor")); //Plots0

Plots[0].Pen.Width = 4;

sSMin = new DataSeries(this);
sSMax = new DataSeries(this);
sTrend = new DataSeries(this);
sUp = new DataSeries(this);
sDn = new DataSeries(this);

CalculateOnBarClose = false;
Overlay = true;
PriceTypeSupported = false;
PaintPriceMarkers = true; // suggested by Silvester17 to decrease right margin
PlotsConfigurable=false;
main = new DataSeries(this, MaximumBarsLookBack.Infinite);
}


protected override void OnStartUp()
{
try{
Plots[0].Pen.Width = plot0Width;
Plots[0].PlotStyle = plot0Style;
Plots[0].Pen.DashStyle = dash0Style;
double dummy =main[0];
lastrefreshbar=this.lastBar;
main.Set(0);
Print (lastrefreshbar+ " ---- "+CurrentBar);


}
catch (Exception e)
{
Print("Bar#"+CurrentBar + " Step MA Line 122 " + e.ToString());
return;
}

}

public override void GetMinMaxValues(ChartControl chartControl, ref double min, ref double max)
{ try{
lastBar = Math.Min(this.LastBarIndexPainted, Bars.Count - 1);
firstBar = this.FirstBarIndexPainted;
if(!Overlay){
min=Double.MaxValue;
double minimum=min ;
double maximum=max;
max=Double.MinValue;

for(int index=firstBar;index<=lastBar;index++)
{
if ((index<=lastcalcbar) && (index >=Math.Max(1,startbar)))
{
min=Math.Min(min,main.Get(index));
max=Math.Max(max,main.Get(index));
}
}
if ((max-min)<.00000001)
{ min -=.00000001;
max +=.00000001;
}
}

}catch (Exception ex){Print("Bar#"+CurrentBar+" StepMa line 140 " + ex.Message);
return ;
}
}
protected void GetPrecision()
{
string PriceString=Close[0].ToString();
int decimalpointlocation=0;int PriceStringLength=0;
PriceStringLength = Math.Max(PriceStringLength,PriceString.Length);
decimalpointlocation=(PriceString.IndexOf("."));
if(decimalpointlocation!=-1 )precision=Math.Max(precision,PriceStringLength-decimalpointlocation-1);
precisionstring=zerostring.Substring(0,precision+1);

if(Instrument.FullName.Substring(0,2)=="ZB"){ Treasury=true;}
if(Instrument.FullName.Substring(0,2)=="ZN"){ Treasury=true;}
}

protected override void OnBarUpdate()
{
try{
if(CurrentBar <= iLength) return;
if(!init)lastrefreshbar=CurrentBar;init=true;
if((CurrentBars[0]-lastrefreshbar)<5){ GetPrecision(); }
//Compute The Step SizE
int vStep = (int)StepSizeCalc(iLength, iKv, iStepSize);

//Compute the Step MA
double vStepMA = StepMACalc(iHighLow, vStep) + (iPercentage / 100.0) * vStep * (TickSize * iTenthPip);

//************
//Color Mode 0
//************
if (ColorMode == 0)
{
Values[0].Set(vStepMA);
main.Set(Values[0][0]);
buffer=(vStepMA);
PlotColors[0][0]=ColorNeutral;
return;
}

//************
//Color Mode 1
//************
if (ColorMode == 1)
{
// Buffer Values to connect lines
sUp.Set(vStepMA - vStep * (TickSize * iTenthPip));
sDn.Set(vStepMA + vStep * (TickSize * iTenthPip));

if (sTrend[0] > 0)
{
buffer=(vStepMA - vStep * (TickSize * iTenthPip));
//Values[0].Set(buffer);
//main.Set(Values[0][0]);
//PlotColors[0][0]=ColorRising;
//if (sTrend[0] != sTrend[1])
// StepUp.Set(1, sUp[1]);
}

if (sTrend[0] < 0)
{
buffer=(vStepMA + vStep * (TickSize * iTenthPip));
//Values[0].Set(buffer);
//main.Set(Values[0][0]);
// StepDn.Set(vStepMA + vStep * (TickSize * iTenthPip));
// if (sTrend[0] != sTrend[1])
//StepDn.Set(1, sDn[1]);
}
Values[0].Set(buffer);
main.Set(Values[0][0]);

if(Rising(Values[0]))PlotColors[0][0]=upColor;
else if(Falling(Values[0]))PlotColors[0][0]=downColor;
else PlotColors[0][0]=neutralColor;
return;
}

//************
//Color Mode 2
//************
if (ColorMode == 2)
{
// Buffer Values to connect lines
sUp.Set(vStepMA);
sDn.Set(vStepMA);
buffer=vStepMA;
Values[0].Set(vStepMA);
main.Set(Values[0][0]);
if (sTrend[0] > 0)
{
//PlotColors[0][0]=ColorRising;
}
if (sTrend[0] < 0)
{
//PlotColors[0][0]=ColorFalling;
}
if(Rising(Values[0]))
{
PlotColors[0][0]=upColor;
prevcolor = upColor; // modified by TheWizard march 18, 2014
}
else if(Falling(Values[0]))
{
PlotColors[0][0]=downColor;
prevcolor = downColor;// modified by TheWizard march 18, 2014
}
else PlotColors[0][0]=prevcolor;// modified by TheWizard march 18, 2014
return;
}
// ColorMode 3 section added by TheWizard September 8, 2013. Also allows for coloring the price bars
if(ColorMode ==3)
{
// Buffer Values to connect lines
sUp.Set(vStepMA);
sDn.Set(vStepMA);
buffer=vStepMA;
Values[0].Set(vStepMA);
main.Set(Values[0][0]);

if((Close[0] > vStepMA) && (Open[0] > vStepMA))
{
PlotColors[0][0] = upColor;
if(colorbars)
{
if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)
{
if(Close[0] > Open[0])
{
BarColor = upColor;
CandleOutlineColor = Color.Gray;
prevcolor = upColor;
if((arrows) && (uparrowdrawn==false))
{
DrawArrowUp("Up arrow" + CurrentBar, false, 0, Low[0]-2*TickSize, upColor);
uparrowdrawn=true;
dnarrowdrawn=false;
}
}
if(Close[0] < Open[0])
{
BarColor = Color.LightBlue;
CandleOutlineColor = Color.Gray;
prevcolor = Color.LightBlue;
uparrowdrawn=false;
}
}
}
}
else if((Close[0] < vStepMA) && (Open[0] < vStepMA))
{
PlotColors[0][0] = downColor;
if(colorbars)
{
if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)
{
if(Close[0] < Open[0])
{
BarColor = downColor;
CandleOutlineColor = Color.Gray;
prevcolor = downColor;
if((arrows) && (dnarrowdrawn==false))
{
DrawArrowDown("Down arrow" + CurrentBar, false, 0, High[0]+2*TickSize, downColor);
dnarrowdrawn=true;
uparrowdrawn=false;
}
}
if(Close[0] > Open[0])
{
BarColor = Color.Pink;
CandleOutlineColor = Color.Gray;
prevcolor = Color.Pink;
dnarrowdrawn=false;
}
}
}
}
else
{
PlotColors[0][0] = neutralColor;
if(colorbars)
{
if (ChartControl.ChartStyleType == ChartStyleType.CandleStick)
{
{
BarColor = Color.Yellow;
// BarColor = prevcolor;
CandleOutlineColor = Color.Gray;
uparrowdrawn=false;
dnarrowdrawn=false;
}
}
}
}


}
}catch (Exception ex){Print("Bar#"+CurrentBar+" StepMa line 256 " + ex.Message);return ;}
} //End Bar Update

//*********************************************************
//*********************************************************
private double StepMACalc(bool iHL, double iSize)
{
double result;

if (iHL)
{
sSMax.Set(Low[0] + 2.0 * iSize * (TickSize * iTenthPip));
sSMin.Set(High[0] - 2.0 * iSize * (TickSize * iTenthPip));
}
else
{
sSMax.Set(Close[0] + 2.0 * iSize * (TickSize * iTenthPip));
sSMin.Set(Close[0] - 2.0 * iSize * (TickSize * iTenthPip));
}

sTrend.Set(sTrend[1]);

if (Close[0] > sSMax[1])
sTrend.Set(1);

if (Close[0] < sSMin[1])
sTrend.Set(-1);

if (sTrend[0] > 0)
{
if (sSMin[0] < sSMin[1])
sSMin[0] = sSMin[1];

result = sSMin[0] + iSize * (TickSize * iTenthPip);
}
else
{
if (sSMax[0] > sSMax[1])
sSMax[0] = sSMax[1];

result = sSMax[0] - iSize * (TickSize * iTenthPip);
}

return result;
}

//*********************************************************
//*********************************************************
private double StepSizeCalc(int iLen, double iKm, int iSize)
{

double alfa;
double result;
double weight = 0;
double avgRange = 0;

if (iSize == 0)
{

//Don't include current bar ?? (i = 1)
for (int i = 1 ; i <= iLen ; i++)
{
if (iAverageType == MAAverageType.SMA)
alfa= 1.0;
else
alfa = 1.0 * (iLen - i) / iLen;

avgRange += alfa * (High[i] - Low[i]);
weight += alfa;
}

vATR0 = avgRange / weight;

if (vATR0 > vATRmax)
vATRmax = vATR0;
if (vATR0 < vATRmin)
vATRmin = vATR0;

result = Math.Round(0.5 * iKm * (vATRmax + vATRmin) / (TickSize * iTenthPip));
}
else
{
result = iKm * iSize;
}

return(result);
}

// public override string FormatPriceMarker(double price) // commented out by Silvester17 to decrease right price margin Feb 26, 2014
// {
// try{
// string bbb="=";
// //if(CurrentBar<(2+iLength) || lastBar==null|| main==null||precision==null||CurrentBar<this.FirstVisibleBar)return "Starting";
// b=CurrentBar-lastBar;
// //if( b!=0)bbb="["+b+"]=";
// if(main.Count>1)hValue=main[b];
//
//
// if(Instrument.FullName==null) return "f";
// if(!Treasury ) priceMarker= "StepMA"+bbb+ hValue.ToString("0."+precisionstring);
//
// else
// {
// trunc = Math.Truncate(hValue);
// fraction = Convert.ToInt32(320 * Math.Abs(hValue - trunc) - 0.000001); // rounding down for ZF and ZT
// fractional = Math.Round((decimal) fraction/10,1);
// if (fraction != 0) priceMarker = "StepMA"+bbb+trunc.ToString() + " '" + fractional.ToString();
// else priceMarker = "StepMA"+bbb+trunc.ToString() + " 00";
// }
// if (priceMarker==null)priceMarker="Null";
// return priceMarker;
//
// }catch (Exception ex){Print("Bar#"+CurrentBar+" StepMA line 323 " + " " +b+" "+ ex.Message);
// return "e";
// }
// }



#region Properties

[Description("Line Width for Plot")]
[Category("Plot Attributes")]
[Gui.Design.DisplayNameAttribute("Line Width")]
public int Plot0Width
{
get { return plot0Width; }
set { plot0Width = Math.Max(1, value); }
}

/// <summary>
/// </summary>
[Description("PlotStyle for Plot")]
[Category("Plot Attributes")]
[Gui.Design.DisplayNameAttribute("PlotStyle")]
public PlotStyle Plot0Style
{
get { return plot0Style; }
set { plot0Style = value; }
}

/// <summary>
/// </summary>
[Description("DashStyle for Plot")]
[Category("Plot Attributes")]
[Gui.Design.DisplayNameAttribute("DashStyle")]
public DashStyle Dash0Style
{
get { return dash0Style; }
set { dash0Style = value; }
}


[XmlIgnore()]
[Description("Color for Neutral Plot")]
[Category("Plots-Colors")]
public Color ColorNeutral
{
get { return neutralColor; }
set { neutralColor = value; }
}

// Serialize our Color object
[Browsable(false)]
public string ColorNeutralSerialize
{
get { return NinjaTrader.Gui.Design.SerializableColor.ToString(neutralColor); }
set { neutralColor = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
}

[XmlIgnore()]
[Description("Color for Falling Plot")]
[Category("Plots-Colors")]
public Color ColorFalling
{
get { return downColor; }
set { downColor = value; }
}

// Serialize our Color object
[Browsable(false)]
public string ColorFallingSerialize
{
get { return NinjaTrader.Gui.Design.SerializableColor.ToString(downColor); }
set { downColor = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
}

[XmlIgnore()]
[Description("Color for Rising Plot")]
[Category("Plots-Colors")]
public Color ColorRising
{
get { return upColor; }
set { upColor = value; }
}

[Browsable(false)]
public string ColorRisingSerialize
{
get { return NinjaTrader.Gui.Design.SerializableColor.ToString(upColor); }
set { upColor = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
}




[Description("iLength")]
[Category("Parameters")]
public int Length
{
get { return iLength; }
set { iLength = Math.Max(1, value); }
}
[Description("iStepSize")]
[Category("Parameters")]
public int StepSize
{
get { return iStepSize; }
set { iStepSize = Math.Max(0, value); }
}
[Description("TenthPip. Set to 10 for MBT users, otherwise 1")]
[Category("Parameters")]
public int TenthPip
{
get { return iTenthPip; }
set { iTenthPip = Math.Max(1, value); }
}
[Description("Moving Average Type")]
[Category("Parameters")]
public MAAverageType MAType
{
get { return iAverageType; }
set { iAverageType = value; }
}
[Description("iKv")]
[Category("Parameters")]
public double Kv
{
get { return iKv; }
set { iKv = Math.Max(0, value); }
}
[Description("iPercentage")]
[Category("Parameters")]
public double Percentage
{
get { return iPercentage; }
set { iPercentage = value; }
}
[Description("iHighLow")]
[Category("Parameters")]
public bool HighLow
{
get { return iHighLow; }
set { iHighLow = value; }
}
[Description("iColorMode (1, 2 or 3)")]
[Category("Parameters")]
public int ColorMode
{
get { return iColorMode; }
set { iColorMode = Math.Max(0, value); }
}
// added by TheWizard September 8, 2013
[Description("Color Price Bars?")]
[Category("Plots-Colors")]
public bool Colorbars
{
get { return colorbars; }
set { colorbars = value; }
}

[Description("Arrows?")]
[Category("Plots-Colors")]
public bool Arrows
{
get { return arrows; }
set { arrows = value; }
}
#endregion
}
}

#region NinjaScript generated code. Neither change nor remove.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
public partial class Indicator : IndicatorBase
{
private StepMaV72Sharky[] cacheStepMaV72Sharky = null;

private static StepMaV72Sharky checkStepMaV72Sharky = new StepMaV72Sharky();

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public StepMaV72Sharky StepMaV72Sharky(int colorMode, bool highLow, double kv, int length, MAAverageType mAType, double percentage, int stepSize, int tenthPip)
{
return StepMaV72Sharky(Input, colorMode, highLow, kv, length, mAType, percentage, stepSize, tenthPip);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public StepMaV72Sharky StepMaV72Sharky(Data.IDataSeries input, int colorMode, bool highLow, double kv, int length, MAAverageType mAType, double percentage, int stepSize, int tenthPip)
{
if (cacheStepMaV72Sharky != null)
for (int idx = 0; idx < cacheStepMaV72Sharky.Length; idx++)
if (cacheStepMaV72Sharky[idx].ColorMode == colorMode && cacheStepMaV72Sharky[idx].HighLow == highLow && Math.Abs(cacheStepMaV72Sharky[idx].Kv - kv) <= double.Epsilon && cacheStepMaV72Sharky[idx].Length == length && cacheStepMaV72Sharky[idx].MAType == mAType && Math.Abs(cacheStepMaV72Sharky[idx].Percentage - percentage) <= double.Epsilon && cacheStepMaV72Sharky[idx].StepSize == stepSize && cacheStepMaV72Sharky[idx].TenthPip == tenthPip && cacheStepMaV72Sharky[idx].EqualsInput(input))
return cacheStepMaV72Sharky[idx];

lock (checkStepMaV72Sharky)
{
checkStepMaV72Sharky.ColorMode = colorMode;
colorMode = checkStepMaV72Sharky.ColorMode;
checkStepMaV72Sharky.HighLow = highLow;
highLow = checkStepMaV72Sharky.HighLow;
checkStepMaV72Sharky.Kv = kv;
kv = checkStepMaV72Sharky.Kv;
checkStepMaV72Sharky.Length = length;
length = checkStepMaV72Sharky.Length;
checkStepMaV72Sharky.MAType = mAType;
mAType = checkStepMaV72Sharky.MAType;
checkStepMaV72Sharky.Percentage = percentage;
percentage = checkStepMaV72Sharky.Percentage;
checkStepMaV72Sharky.StepSize = stepSize;
stepSize = checkStepMaV72Sharky.StepSize;
checkStepMaV72Sharky.TenthPip = tenthPip;
tenthPip = checkStepMaV72Sharky.TenthPip;

if (cacheStepMaV72Sharky != null)
for (int idx = 0; idx < cacheStepMaV72Sharky.Length; idx++)
if (cacheStepMaV72Sharky[idx].ColorMode == colorMode && cacheStepMaV72Sharky[idx].HighLow == highLow && Math.Abs(cacheStepMaV72Sharky[idx].Kv - kv) <= double.Epsilon && cacheStepMaV72Sharky[idx].Length == length && cacheStepMaV72Sharky[idx].MAType == mAType && Math.Abs(cacheStepMaV72Sharky[idx].Percentage - percentage) <= double.Epsilon && cacheStepMaV72Sharky[idx].StepSize == stepSize && cacheStepMaV72Sharky[idx].TenthPip == tenthPip && cacheStepMaV72Sharky[idx].EqualsInput(input))
return cacheStepMaV72Sharky[idx];

StepMaV72Sharky indicator = new StepMaV72Sharky();
indicator.BarsRequired = BarsRequired;
indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
indicator.Input = input;
indicator.ColorMode = colorMode;
indicator.HighLow = highLow;
indicator.Kv = kv;
indicator.Length = length;
indicator.MAType = mAType;
indicator.Percentage = percentage;
indicator.StepSize = stepSize;
indicator.TenthPip = tenthPip;
Indicators.Add(indicator);
indicator.SetUp();

StepMaV72Sharky[] tmp = new StepMaV72Sharky[cacheStepMaV72Sharky == null ? 1 : cacheStepMaV72Sharky.Length + 1];
if (cacheStepMaV72Sharky != null)
cacheStepMaV72Sharky.CopyTo(tmp, 0);
tmp[tmp.Length - 1] = indicator;
cacheStepMaV72Sharky = tmp;
return indicator;
}
}
}
}

// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
public partial class Column : ColumnBase
{
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.StepMaV72Sharky StepMaV72Sharky(int colorMode, bool highLow, double kv, int length, MAAverageType mAType, double percentage, int stepSize, int tenthPip)
{
return _indicator.StepMaV72Sharky(Input, colorMode, highLow, kv, length, mAType, percentage, stepSize, tenthPip);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public Indicator.StepMaV72Sharky StepMaV72Sharky(Data.IDataSeries input, int colorMode, bool highLow, double kv, int length, MAAverageType mAType, double percentage, int stepSize, int tenthPip)
{
return _indicator.StepMaV72Sharky(input, colorMode, highLow, kv, length, mAType, percentage, stepSize, tenthPip);
}
}
}

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
public partial class Strategy : StrategyBase
{
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
[Gui.Design.WizardCondition("Indicator")]
public Indicator.StepMaV72Sharky StepMaV72Sharky(int colorMode, bool highLow, double kv, int length, MAAverageType mAType, double percentage, int stepSize, int tenthPip)
{
return _indicator.StepMaV72Sharky(Input, colorMode, highLow, kv, length, mAType, percentage, stepSize, tenthPip);
}

/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public Indicator.StepMaV72Sharky StepMaV72Sharky(Data.IDataSeries input, int colorMode, bool highLow, double kv, int length, MAAverageType mAType, double percentage, int stepSize, int tenthPip)
{
if (InInitialize && input == null)
throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

return _indicator.StepMaV72Sharky(input, colorMode, highLow, kv, length, mAType, percentage, stepSize, tenthPip);
}
}
}
#endregion

Reply With Quote




Last Updated on February 12, 2020


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts