Obviously I need to resolve this before I go into production.
I have added a simple piece of code below that, surprisingly, will not adhere to my predefined limits.
Regards.
Also: DayRelChangeFromOpen = % change between Close[0] and opening print, so 2 = 2%
__________________________________________________ _____________
#namespace NinjaTrader.Strategy
{
Description("Enter the description of your strategy here")]
publicclass tester : Strategy
{
#region Variables
#endregion
protectedoverridevoid Initialize()
{
SetStopLoss("", CalculationMode.Percent, 1, false);
SetProfitTarget("", CalculationMode.Percent, 1);
CalculateOnBarClose = true;
}
protectedoverridevoid OnBarUpdate()
{
if (DayRelChangeFromOpen()[0] >= 2)
{
EnterLong(100, "");
}
if (DayRelChangeFromOpen()[0] <= -2)
{
EnterShort(100, "");
}
}
#region Properties
#endregion
}
}
Comment