Adding amaSuperTrendU11 to custom strategy - compile error - Traders Hideout | futures io social day trading
futures io futures trading


Adding amaSuperTrendU11 to custom strategy - compile error
Updated: Views / Replies:910 / 12
Created: by Fassenkugel Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

 
 1  
 
Thread Tools
 

Adding amaSuperTrendU11 to custom strategy - compile error

 
Munchen / Garching
 
Trading Experience: None
Platform: Ninja
Favorite Futures: CL + DAX
 
Posts: 8 since Oct 2014
Thanks: 0 given, 2 received

Adding amaSuperTrendU11 to custom strategy - compile error

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.

 
 
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
 
Market Wizard
Gits (Hooglede) Belgium
 
Trading Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,955 since Sep 2013
Thanks: 2,404 given, 5,487 received


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

Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal
 
 
Munchen / Garching
 
Trading Experience: None
Platform: Ninja
Favorite Futures: CL + DAX
 
Posts: 8 since Oct 2014
Thanks: 0 given, 2 received


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: https://futures.io/elite-automated-ninjatrader-trading/11208-auto-trading-ninjatrader-7-newbies-3.html#post126728)

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!

 
 
Market Wizard
Gits (Hooglede) Belgium
 
Trading Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,955 since Sep 2013
Thanks: 2,404 given, 5,487 received

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

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

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal
 
 
Munchen / Garching
 
Trading Experience: None
Platform: Ninja
Favorite Futures: CL + DAX
 
Posts: 8 since Oct 2014
Thanks: 0 given, 2 received


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/

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

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!

The following user says Thank You to Fassenkugel for this post:
 
 
Market Wizard
Gits (Hooglede) Belgium
 
Trading Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,955 since Sep 2013
Thanks: 2,404 given, 5,487 received


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 Facebook Visit my futures io Trade Journal
The following user says Thank You to rleplae for this post:
 
 
Market Wizard
Berlin, Europe
 
Trading Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,779 since Mar 2010
Thanks: 4,234 given, 26,286 received

Answer
This post has been selected as an answer to the original posters question Answer

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), "");
	}
		
}
}

The following 2 users say Thank You to Fat Tails for this post:
 
 
Denver colorado
 
Trading Experience: Intermediate
Platform: Nt
Favorite Futures: Es
 
Posts: 6 since Jan 2018
Thanks: 0 given, 2 received

help ninja script

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

 
 
Market Wizard
New York, NY
 
Trading Experience: Intermediate
Platform: NinjaTrader8
Broker/Data: Data = Rithmic -- Gives 70 Level II Data
Favorite Futures: 6C (Low Margin,) 6E, CL, GC, ES and Maybe DX for smaller tick value
 
Posts: 1,064 since May 2011
Thanks: 1,474 given, 774 received

Strategy Builder with SuperTrend



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.


 



futures io > > > Adding amaSuperTrendU11 to custom strategy - compile error
Thread Tools



Upcoming Webinars and Events (4:30PM ET unless noted)
 

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$1,000 in Amazon Gift Cards being given away right now from GFF Brokers

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading

August
 

Webinar: Chart Patterns and Practical Trading Stats w/Suri Duddella

Elite only
 

Webinar: Richard Bailey (TBA)

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Anyone Provide AmaSuperTrendU11 Strategy file (.cs) for Ninjatrader 8 ? kashyapjdave NinjaTrader Programming 7 January 31st, 2018 01:07 PM
Compile Error nodoji Sierra Chart 6 July 6th, 2015 02:05 AM
Help with compile error when importing indicator from NT6.5 to NT7 bergvall63 NinjaTrader 13 September 5th, 2014 09:22 PM
@ADL.CS Compile Error Alan NinjaTrader Programming 5 February 17th, 2010 04:30 AM
Error on Compile Maletor NinjaTrader Programming 2 June 13th, 2009 03:30 PM


All times are GMT -4. The time now is 11:55 PM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts