Hi,

 this code only generates one trade and it should generate more trades.
 I've added the plot functions to confirm if the signals were being
correctly generated, and through the chart i can see that the three
conditions are true several times, but only one trade is generated.
In the backtesting settings I have the stops defined.
What am I doing wrong?

 TimeFrameSet(inHourly);
cond1=C>EMA(C,20);
cond2=Ref(MACD(),-2)>0 AND Ref(MACD(),-1)>0;
TimeFrameRestore();
Cond3=C<EMA(C,20);
cond115m=TimeFrameExpand(cond1,inHourly);
cond215m=TimeFrameExpand(cond2,inHourly);
Buy=cond115m AND cond215m AND Cond3;
Sell=0;

Plot(Cond115m,"cond115m",colorGreen);
Plot(Cond215m,"cond215m",colorBlue);
Plot(Cond3,"cond3",colorRed);

thanks


Reply via email to