I develop a strategy with 2 entries, 1 stop and 2 targets
if (State == State.SetDefaults)
{
Description = "Test2Targets";
Name = "Test2Targets";
Fast = 10;
Slow = 25;
// This strategy has been designed to take advantage of performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = false;
SetOrderQuantity = SetOrderQuantity.Strategy;
EntriesPerDirection = 2;
StopTicks = 50;
TargetTicks1 = 25;
TargetTicks2 = 100;
TraceOrders = true;
}
else if (State == State.Configure)
{
SetStopLoss(CalculationMode.Ticks, StopTicks);
SetProfitTarget("MAcross1", CalculationMode.Ticks, TargetTicks1);
SetProfitTarget("MAcross2", CalculationMode.Ticks, TargetTicks2);
}
entries on MA cross
if (CrossAbove(smaFast, smaSlow, 1))
{
EnterLong(1, "MAcross1");
EnterLong(1, "MAcross2");
}
else if (CrossBelow(smaFast, smaSlow, 1))
{
EnterShort(1, "MAcross1");
EnterShort(1, "MAcross2");
}
both profit targets are with quantity 2, I would expect each profit target is with quantity 1
strategy, trace and logs, screenshot attached
Comment