{
SetProfitTarget("MACDLONG", CalculationMode.Ticks, 120);
SetProfitTarget("MACDSHORT", CalculationMode.Ticks, 120);
SetStopLoss("MACDLONG", CalculationMode.Ticks, 17, false);
SetStopLoss("MACDSHORT", CalculationMode.Ticks, 17, false);
//SetProfitTarget(Mprofit);
//SetStopLoss(MLoss, false);
Add(PeriodType.Minute,8);
CalculateOnBarClose = false;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{ // Long 10 Minutes
if (BarsInProgress == 0)
{
EnterLong();
}
if (BarsInProgress ==1 )
{
EnterShort();
}
return;
Why am I getting the following: Order for strategy 'MacdComplete_1_4PM' was placed in incorrect 'BarsInProgress' context. Order ignored.
I am trying to combine 2 strategies into 1. How can I Sell Short on the second time period? It does really tell me how in the example.
Comment