NexusFi: Find Your Edge


Home Menu

 





Adding amaSuperTrendU11 to custom strategy - compile error


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one rleplae with 3 posts (1 thanks)
    2. looks_two Fat Tails with 3 posts (6 thanks)
    3. looks_3 Fassenkugel with 3 posts (1 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 4,439 views
    2. thumb_up 8 thanks given
    3. group 7 followers
    1. forum 12 posts
    2. attach_file 1 attachments




 
Search this Thread

Adding amaSuperTrendU11 to custom strategy - compile error

  #1 (permalink)
 Fassenkugel 
Munchen / Garching
 
Experience: None
Platform: Ninja
Trading: CL + DAX
Posts: 8 since Oct 2014
Thanks Given: 0
Thanks Received: 3

Hi!

I'm developing a strategy and want to rely on amaSuperTrendU11 indicator. However when I try to declare it as a private amaSuperTrendU11 myIndie; I get a compile error right at the start. CS0118 - Saying something like a method constructor used as a type. What I don't understand is that in the indicator itself the definition is public class amaSuperTrendU11 : Indicator, hence it should be correct.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #3 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


please post a bit of code of what you do
and the error

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 Fassenkugel 
Munchen / Garching
 
Experience: None
Platform: Ninja
Trading: CL + DAX
Posts: 8 since Oct 2014
Thanks Given: 0
Thanks Received: 3


rleplae View Post
please post a bit of code of what you do
and the error

Hi!

Basically I want to have a reference to the indicator in my strategy.

private amaSuperTrendU11 myIndie;

When I add the line above I can't compile my strategy anymore. (CS0118 - method used like a type.) I recon the compiler thinks the amaSuperTrendU11 is a constructor call instead of the type definition. However as I looked into the source of the indicator I saw the following definition:

public class amaSuperTrendU11 : Indicator{...}

So if the class name is indeed amaSuperTrendU11 then I should be able to use it as a type right?
(While doing this I was following this forum: )

In the end I want to have a reference (myIndie), that I initialize at startup (myIndie = amaSuperTrendU11(...) and then finally get the Trend variable of the indicator in my strategy. Meanwhile the forum uses anaSuperTrend as I'm on Ninja 8 I decided to use amaSuperTrendU11

Thanks in advance!

Started this thread Reply With Quote
  #5 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863

This may be a helpful post for you, as it goes through the details :

https://www.theindicatorclub.com/ninjatrader-training-part-8-referencing-indicators/


Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 Fassenkugel 
Munchen / Garching
 
Experience: None
Platform: Ninja
Trading: CL + DAX
Posts: 8 since Oct 2014
Thanks Given: 0
Thanks Received: 3


rleplae View Post
This may be a helpful post for you, as it goes through the details :

https://www.theindicatorclub.com/ninjatrader-training-part-8-referencing-indicators/


Thanks, I will read it through in the evening.

That is exactly what I did (but swapped the EMA name to the amaSuperTrendU11)... And it broke somehow immediately. Maybe I will ask Fat Tails. Thanks for the blog post snippet!

Started this thread Reply With Quote
Thanked by:
  #7 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


Fassenkugel View Post
Thanks, I will read it through in the evening.

That is exactly what I did (but swapped the EMA name to the amaSuperTrendU11)... And it broke somehow immediately. Maybe I will ask Fat Tails. Thanks for the blog post snippet!

try with ema
if that works something is wrong with the supertrend

in the beta of 8 i saw weird things with the generated code
being missed, etc

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #8 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

The amaSuperTrendU11 may be used with automated strategies without restrictions. I have already created a few SuperTrend strategies that were just doing fine.

In case that you do not know, how to call the amaSuperTrendU11 from a strategy, this is what I recommend:

- open the strategy builder and create a simple stop and reverse strategy by using the trend plot from the amaSuperTrendU11
- unlock and compile the strategy to make sure that it works as expected

Now study the code of the strategy and copy what you need. Below is a sample strategy that compiles. I think it will probably answer your questions.

 
Code
public class MyCustomStrategy6 : Strategy
{
private NinjaTrader.NinjaScript.Indicators.LizardIndicators.amaSuperTrendU11 amaSuperTrendU111;

protected override void OnStateChange()
{
	if (State == State.SetDefaults)
	{
		Description						= @"Enter the description for your new custom Strategy here.";
		Name							= "MyCustomStrategy6";
		Calculate						= Calculate.OnBarClose;
		EntriesPerDirection					= 1;
		EntryHandling						= EntryHandling.AllEntries;
		IsExitOnSessionCloseStrategy				= true;
		ExitOnSessionCloseSeconds				= 30;
		IsFillLimitOnTouch					= false;
		MaximumBarsLookBack					= MaximumBarsLookBack.TwoHundredFiftySix;
		OrderFillResolution					= OrderFillResolution.Standard;
		Slippage						= 0;
		StartBehavior						= StartBehavior.WaitUntilFlat;
		TimeInForce						= TimeInForce.Gtc;
		TraceOrders						= false;
		RealtimeErrorHandling					= RealtimeErrorHandling.StopCancelClose;
		StopTargetHandling					= StopTargetHandling.PerEntryExecution;
		BarsRequiredToTrade					= 20;
		// Disable this property for performance gains in Strategy Analyzer optimizations
		// See the Help Guide for additional information
		IsInstantiatedOnEachOptimizationIteration	        = true;
	}
	else if (State == State.Configure)
	{
	}
	else if (State == State.DataLoaded)
	{				
		amaSuperTrendU111 = amaSuperTrendU11(Close, amaSuperTrendU11BaseType.Median, amaSuperTrendU11VolaType.True_Range, amaSuperTrendU11OffsetType.Wilder, false, 8, 15, 2.5);
	}
}

protected override void OnBarUpdate()
{
	if (BarsInProgress != 0) 
		return;
		if (CurrentBars[0] < 1)
	return;

	 // Set 1
	if ((amaSuperTrendU111.Trend[0] > 0)
		 && (amaSuperTrendU111.Trend[1] < 0))
	{
		EnterLong(Convert.ToInt32(DefaultQuantity), "");
	}
		
	 // Set 2
	if ((amaSuperTrendU111.Trend[0] < 0)
		 && (amaSuperTrendU111.Trend[1] > 0))
	{
		EnterShort(Convert.ToInt32(DefaultQuantity), "");
	}
		
}
}

Reply With Quote
Thanked by:
  #9 (permalink)
 Phatboyz 
Denver colorado
 
Experience: Intermediate
Platform: Nt
Trading: Es
Posts: 6 since Jan 2018
Thanks Given: 0
Thanks Received: 2

I am trying to imply this indicator into the strategy builder NT8 but error coming.

namespace NinjaTrader.NinjaScript.Indicators.Sim22
{
/// <summary>
/// The Stochastic Oscillator is made up of two lines that oscillate between a vertical scale of 0 to 100. The %K is the main line and it is drawn as a solid line. The second is the %D line and is a moving average of %K. The %D line is drawn as a dotted line. Use as a buy/sell signal generator, buying when fast moves above slow and selling when fast moves below slow.
/// Sim22 May 2016 NT8b11.
/// Update V1.1: Moved input code to State.DataLoaded due to exceptions when placed in the market analyzer
/// </summary>
public class Sim22_DoubleStochastic_Colored_AnyInputGLV1 : Indicator
{
#region Variables


private double ob = 0.0;
private double os = 0.0;

private Series<double> KUpperBand;
private Series<double> KLowerBand;

private EMA emaP1;
private EMA emaP3;
private MIN minLow;
private MIN minP2;
private MAX maxHigh;
private MAX maxP2;
private Series<double> p1;
private Series<double> p2;
private Series<double> p3;
private int barNumberFromSessOpen;
private double gap = 0.0;
bool isPriceSeries = true;

Brush tempUpperBrush = Brushes.Transparent;
Brush tempLowerBrush = Brushes.Transparent;

#endregion

protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Name = "Sim22_DoubleStochastic_Colored_AnyInputGLV1.1";
Description = "Intraday Double Stochastics colored that ignores price gaps at the start of the intraday session. Use any input including indicators. Sim22 May 2016 NT8b10.";
IsOverlay = false;
DrawOnPricePanel = false;
Calculate = Calculate.OnPriceChange;
DrawKRegion = true;
OpacityKRegion = 30;
Period = 10;
UseGapless = true;
PlotPopsPoops = false;
PlotReversals = true;
ReverseColors = false;


AddPlot(new Stroke(Brushes.LimeGreen, DashStyleHelper.Solid, 2f), PlotStyle.Line, "KUpper");
AddPlot(new Stroke(Brushes.Gray, DashStyleHelper.Solid, 1f), PlotStyle.Line, "KMiddle");
AddPlot(new Stroke(Brushes.Red, DashStyleHelper.Solid, 2f), PlotStyle.Line, "KLower");

AddPlot(new Stroke(Brushes.Cyan, 4), PlotStyle.TriangleUp, "KReversalUp");
AddPlot(new Stroke(Brushes.Magenta, 4), PlotStyle.TriangleDown, "KReversalDown");

AddPlot(new Stroke(Brushes.LimeGreen, 4), PlotStyle.TriangleUp, "KPopUp");
AddPlot(new Stroke(Brushes.Red, 4), PlotStyle.TriangleDown, "KPoopDown");
///'K' is used for price markers only
AddPlot(new Stroke(Brushes.Gray, DashStyleHelper.Solid, 1f), PlotStyle.Line, "K-PriceMarker");

AddLine(new Stroke(Brushes.Red, DashStyleHelper.Dash, 1f), 10, "Lower");
AddLine(new Stroke(Brushes.LimeGreen, DashStyleHelper.Dash, 1f), 90, "Upper");

}
else if (State == State.Configure)
{
p1 = new Series<double>(this);
p2 = new Series<double>(this);
p3 = new Series<double>(this);

emaP1 = EMA(p1, 3);
emaP3 = EMA(p3, 3);
maxP2 = MAX(p2, Period);
minP2 = MIN(p2, Period);

KUpperBand = new Series<double>(this, MaximumBarsLookBack.Infinite);
KLowerBand = new Series<double>(this, MaximumBarsLookBack.Infinite);

///Set limitations for plots
ob = Plots[0].Min = Lines[1].Value;
Plots[1].Max = Lines[1].Value;
Plots[1].Min = Lines[0].Value;
os = Plots[2].Max = Lines[0].Value;

tempUpperBrush.Freeze();
tempLowerBrush.Freeze();

tempUpperBrush = Plots[0].Brush;
tempLowerBrush = Plots[2].Brush;

}
else if (State == State.DataLoaded)
{
////Update 1.1. Moved code here due to exceptions raised when placed in a market analyzer
///
/// Instrument price type
if (Input.GetType() == typeof(NinjaTrader.NinjaScript.PriceSeries))
{
isPriceSeries = true;
maxHigh = MAX(High, Period);
minLow = MIN(Low, Period);
}
else
/// Indicator
{
isPriceSeries = true;
UseGapless = false;
maxHigh = MAX(Input, Period);
minLow = MIN(Input, Period);

}

}
}

public override void OnCalculateMinMax()
{
/// Maintains a fixed scale to show full range of stochastic.
MinValue = 0.0;
MaxValue = 100.00;
if (PlotReversals)
{
MinValue -= Plots[3].Width * 2;
MaxValue += Plots[4].Width * 2;

}
}

public override string DisplayName
{
get { return String.Format("DStoch" + (UseGapless ? "'GL'" : "") + "({0})", Period); }
}


#region FormatNumberDecimalPlaces

Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum dpEnum = Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum.None;

public override string FormatPriceMarker(double value)
{
/* using static class Sim22_PriceFormatter in the Addons folder */
if (dpEnum == Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum.SameAsInstrument)
return Sim22_PriceFormatter.FormatSameAsInstrumentPrice(value, TickSize);
else
return value.ToString("N" + Sim22_PriceFormatter.FormatNumberDecimalPlaces(dpEnum).ToString());
}

#endregion


protected override void OnBarUpdate()
{
try
{
double input = Input[0];

double partialGap = 0.0;

if (UseGapless && IsFirstTickOfBar)
{
if (Bars.IsFirstBarOfSession && CurrentBar > 0)
{
barNumberFromSessOpen = CurrentBar;
gap = Open[0] - Close[1];
}

if ((CurrentBar - barNumberFromSessOpen) < Period)
{
partialGap = gap * (Period - (CurrentBar - barNumberFromSessOpen + 1))/Period;
}
}

double maxHigh0 = maxHigh[0];
double minLow0 = minLow[0];
double r = maxHigh0 - minLow0;
r = r.ApproxCompare(0) == 0 ? 0 : r;

if (r == 0)
p1[0] = CurrentBar == 0 ? 50 : p1[1];
else
p1[0] = Math.Min(100, Math.Max(0, 100 * (input - minLow0 - 2 * partialGap) / (r - partialGap)));

p2[0] = emaP1[0];
double minP20 = minP2[0];
double s = maxP2[0] - minP20;
s = s.ApproxCompare(0) == 0 ? 0 : s;

if (s == 0)
p3[0] = CurrentBar == 0 ? 50 : p3[1];
else
p3[0] = Math.Min(100, Math.Max(0, 100 * (p2[0] - minP20) / s));

double k = emaP3[0];

KLower[0] = KMiddle[0] = KUpper[0] = k;

if (ReverseColors)
{
tempUpperBrush = PlotBrushes[0][0] = Plots[2].Brush;
tempLowerBrush = PlotBrushes[2][0] = Plots[0].Brush;
}

Lines[0].Brush = tempLowerBrush;
Lines[1].Brush = tempUpperBrush;

if (DrawKRegion)
{
KUpperBand[0] = KUpper[0] >= ob ? KUpper[0] : ob;
KLowerBand[0] = KLower[0] <= os ? KLower[0] : os;

Draw.Region(this,"upperK", CurrentBar, 0, KUpperBand, ob, tempUpperBrush, OpacityKRegion);
Draw.Region(this,"lowerK", CurrentBar, 0, KLowerBand, os, tempLowerBrush, OpacityKRegion);
}

if (PaintPriceMarkers && CurrentBar == (Bars.Count - 1))
{
K[0] = k;

if (K[0] >= ob)
PlotBrushes[7][0] = tempUpperBrush;
else if (K[0] <= os)
PlotBrushes[7][0] = tempLowerBrush;
else
PlotBrushes[7][0] = Plots[1].Brush;
}

if (base.IsFirstTickOfBar)
{
if (PlotReversals && CurrentBar > 3)
{
if ((IsRising(KLower)) && ((KLower[1]) < os) && (KLower[2]) >= (KLower[1]))
{
KReversalUp[1] = KUpper[1];
}

if ((IsFalling(KUpper)) && ((KUpper[1]) > ob) && (KUpper[2]) <= (KUpper[1]))
{
KReversalDown[1] = KLower[1];
}
}
}

if (PlotPopsPoops && CurrentBar > 3)
{
if (CrossAbove(KUpper, ob, 1))
{
KPopUp[0] = ob;
}

if (CrossBelow(KLower, os, 1))
{
KPoopDown[0] = os;
}
}
}
catch{}
}

#region Properties



[Browsable(false)]
[XmlIgnore()]
public Series<double> KUpper
{
get { return Values[0]; }
}

[Browsable(false)]
[XmlIgnore()]
public Series<double> KMiddle
{
get { return Values[1]; }
}

[Browsable(false)]
[XmlIgnore()]
public Series<double> KLower
{
get { return Values[2]; }
}

[Browsable(false)]
[XmlIgnore()]
public Series<double> KReversalUp
{
get { return Values[3]; }
}

[Browsable(false)]
[XmlIgnore()]
public Series<double> KReversalDown
{
get { return Values[4]; }
}

[Browsable(false)]
[XmlIgnore()]
public Series<double> KPopUp
{
get { return Values[5]; }
}

[Browsable(false)]
[XmlIgnore()]
public Series<double> KPoopDown
{
get { return Values[6]; }
}

[Browsable(false)]
[XmlIgnore()]
public Series<double> K
{
get { return Values[7]; }
}

[NinjaScriptProperty]
[Display(Name="Decimal Places", Description="", Order=0, GroupName="Set up")]
public Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum DPEnum
{
get { return dpEnum; }
set { dpEnum = value; }
}

[NinjaScriptProperty]
[Display(ResourceType = typeof(Custom.Resource), Name = "(Intraday) Plot gapless?", GroupName = "NinjaScriptParameters", Order = 0)]
public bool UseGapless
{ get; set; }

[Range(1, int.MaxValue), NinjaScriptProperty]
[Display(ResourceType = typeof(Custom.Resource), Name = "Period", GroupName = "NinjaScriptParameters", Order = 2)]
public int Period
{ get; set; }

[NinjaScriptProperty]
[Display(Name = "Plot reversals?", Description = "Plot reversals?", GroupName = ".Plots", Order = 0)]
public bool PlotReversals
{ get; set; }

[NinjaScriptProperty]
[Display(Name = "Plot pops & poops?", Description = "Plot pops & poops?", GroupName = ".Plots", Order = 1)]
public bool PlotPopsPoops
{ get; set; }

[NinjaScriptProperty]
[Display(Name = "Reverse colors?", Description = "Reverse colors?", GroupName = ".Plots", Order = 2)]
public bool ReverseColors
{ get; set; }

[NinjaScriptProperty]
[Display(Name = "Shade K region?", Description = "Shade K region?", GroupName = ".Plots", Order = 5)]
public bool DrawKRegion
{ get; set; }

[Range(0, 100), NinjaScriptProperty]
[Display(Name = "K region opacity (0-100)", Description = "K region opacity (0-100)", GroupName = ".Plots", Order = 6)]
public int OpacityKRegion
{ get; set; }

#endregion
}
}

#region NinjaScript generated code. Neither change nor remove.

namespace NinjaTrader.NinjaScript.Indicators
{
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private Sim22.Sim22_DoubleStochastic_Colored_AnyInputGLV1[] cacheSim22_DoubleStochastic_Colored_AnyInputGLV1;
public Sim22.Sim22_DoubleStochastic_Colored_AnyInputGLV1 Sim22_DoubleStochastic_Colored_AnyInputGLV1(Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum dPEnum, bool useGapless, int period, bool plotReversals, bool plotPopsPoops, bool reverseColors, bool drawKRegion, int opacityKRegion)
{
return Sim22_DoubleStochastic_Colored_AnyInputGLV1(Input, dPEnum, useGapless, period, plotReversals, plotPopsPoops, reverseColors, drawKRegion, opacityKRegion);
}

public Sim22.Sim22_DoubleStochastic_Colored_AnyInputGLV1 Sim22_DoubleStochastic_Colored_AnyInputGLV1(ISeries<double> input, Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum dPEnum, bool useGapless, int period, bool plotReversals, bool plotPopsPoops, bool reverseColors, bool drawKRegion, int opacityKRegion)
{
if (cacheSim22_DoubleStochastic_Colored_AnyInputGLV1 != null)
for (int idx = 0; idx < cacheSim22_DoubleStochastic_Colored_AnyInputGLV1.Length; idx++)
if (cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx] != null && cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx].DPEnum == dPEnum && cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx].UseGapless == useGapless && cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx].Period == period && cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx].PlotReversals == plotReversals && cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx].PlotPopsPoops == plotPopsPoops && cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx].ReverseColors == reverseColors && cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx].DrawKRegion == drawKRegion && cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx].OpacityKRegion == opacityKRegion && cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx].EqualsInput(input))
return cacheSim22_DoubleStochastic_Colored_AnyInputGLV1[idx];
return CacheIndicator<Sim22.Sim22_DoubleStochastic_Colored_AnyInputGLV1>(new Sim22.Sim22_DoubleStochastic_Colored_AnyInputGLV1(){ DPEnum = dPEnum, UseGapless = useGapless, Period = period, PlotReversals = plotReversals, PlotPopsPoops = plotPopsPoops, ReverseColors = reverseColors, DrawKRegion = drawKRegion, OpacityKRegion = opacityKRegion }, input, ref cacheSim22_DoubleStochastic_Colored_AnyInputGLV1);
}
}
}

namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{
public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
{
public Indicators.Sim22.Sim22_DoubleStochastic_Colored_AnyInputGLV1 Sim22_DoubleStochastic_Colored_AnyInputGLV1(Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum dPEnum, bool useGapless, int period, bool plotReversals, bool plotPopsPoops, bool reverseColors, bool drawKRegion, int opacityKRegion)
{
return indicator.Sim22_DoubleStochastic_Colored_AnyInputGLV1(Input, dPEnum, useGapless, period, plotReversals, plotPopsPoops, reverseColors, drawKRegion, opacityKRegion);
}

public Indicators.Sim22.Sim22_DoubleStochastic_Colored_AnyInputGLV1 Sim22_DoubleStochastic_Colored_AnyInputGLV1(ISeries<double> input , Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum dPEnum, bool useGapless, int period, bool plotReversals, bool plotPopsPoops, bool reverseColors, bool drawKRegion, int opacityKRegion)
{
return indicator.Sim22_DoubleStochastic_Colored_AnyInputGLV1(input, dPEnum, useGapless, period, plotReversals, plotPopsPoops, reverseColors, drawKRegion, opacityKRegion);
}
}
}

namespace NinjaTrader.NinjaScript.Strategies
{
public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
{
public Indicators.Sim22.Sim22_DoubleStochastic_Colored_AnyInputGLV1 Sim22_DoubleStochastic_Colored_AnyInputGLV1(Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum dPEnum, bool useGapless, int period, bool plotReversals, bool plotPopsPoops, bool reverseColors, bool drawKRegion, int opacityKRegion)
{
return indicator.Sim22_DoubleStochastic_Colored_AnyInputGLV1(Input, dPEnum, useGapless, period, plotReversals, plotPopsPoops, reverseColors, drawKRegion, opacityKRegion);
}

public Indicators.Sim22.Sim22_DoubleStochastic_Colored_AnyInputGLV1 Sim22_DoubleStochastic_Colored_AnyInputGLV1(ISeries<double> input , Sim22_PriceFormatter.FormatNumberDecimalPlacesEnum dPEnum, bool useGapless, int period, bool plotReversals, bool plotPopsPoops, bool reverseColors, bool drawKRegion, int opacityKRegion)
{
return indicator.Sim22_DoubleStochastic_Colored_AnyInputGLV1(input, dPEnum, useGapless, period, plotReversals, plotPopsPoops, reverseColors, drawKRegion, opacityKRegion);
}
}
}

#endregion

Reply With Quote
  #10 (permalink)
 jmont1 
New York, NY
 
Experience: Intermediate
Platform: NinjaTrader8
Broker: Data = Rithmic -- Gives 70 Level II Data
Trading: 6C (Low Margin,) 6E, CL, GC, ES and Maybe DX for smaller tick value
Posts: 1,394 since May 2011
Thanks Given: 1,719
Thanks Received: 1,019



Fat Tails View Post
The amaSuperTrendU11 may be used with automated strategies without restrictions. I have already created a few SuperTrend strategies that were just doing fine.

In case that you do not know, how to call the amaSuperTrendU11 from a strategy, this is what I recommend:

- open the strategy builder and create a simple stop and reverse strategy by using the trend plot from the amaSuperTrendU11
- unlock and compile the strategy to make sure that it works as expected

Now study the code of the strategy and copy what you need. Below is a sample strategy that compiles. I think it will probably answer your questions.

Fat Tails, created the simple sample reverse strategy in Strategy Builder exactly as you have posted here to confirm amaSupertrend11 would work in a strategy. It compiled fine but Strategy Analyzer would not take any trades with it. I was not expecting it to be a winning trade but at least one in a year back test.
SO I was going to ask for help here. Then I realized how dumb I was to think that the trend would be less than zero when it is based on price.

So now it works - not a winning strategy but it does take trades. Any chance you would post a strategy builder created one that is at least marginally profitable? Or for that matter any strategy marginally profitable. Thanks for your continued support.

I only do a few postings here compared to what you have done. So I did not use "@" before your name because I expect you get way too many emails telling you've been mentioned.

Thanks again.

Reply With Quote




Last Updated on September 11, 2018


© 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