How can I find help in this problem.
Please have a look at the below mentioned example. I wonder if somebody could help me with this.
I want after LONG, SETPROFITTARGET that then follows SHORT. Or SHORT, SETPROFITTARGET and then LONG. I do not want after for example LONG, SETPROFITTARGET that it keeps on with LONG, even the signal is still LONG. I would like to buy just once. But I want the next buy after changing from LONG to SHORT.
Thank you in advance for your help.
protectedoverridevoid Initialize()
{
CalculateOnBarClose = true;
SetProfitTarget("", CalculationMode.Ticks, 20);
setStopLoss("", CalculationMode.Ticks, 20, false);
}
protectedoverridevoid OnBarUpdate()
{
if (CrossAbove(SMA( 10 ), SMA( 30 ), 1))
EnterLong();
elseif (CrossBelow(SMA( 5 ), SMA( 20 ), 1))
EnterShort();
}

Comment