In the backtest, way too many trades are being placed and it does not line up with what I expect my logic to say. Below are the if statements:
/* Conditions for Long Entry */
if (Close[0] > Open[0]
&& Close[0] > MAEnvelopes(MAEPerc, 3, 25).Upper[0]
&& Aroon(14).Up[0] == 100
&& Close[0] > ParabolicSAR(0.02, 0.2, 0.02)[0]
&& Close[0] > Ichimoku(9, 26, 52).KijunSen[0]
&& Close[0] > SMA(SMAPeriod)[0]
&& !barResetUp)
{
SignalCandleLong = true;
}
if (SignalCandleLong == true)
{
signalHigh = High[0];
signalLow = Low[0];
//Order Entries A & B as well as Order for Initial Stop Loss
EnterLongStop(DefaultQuantity, TrendPilotPricesLong(EntryPerc, StopPerc, TargetPerc).LongEntry[0], "LongEntryA");
EnterLongStop(DefaultQuantity, TrendPilotPricesLong(EntryPerc, StopPerc, TargetPerc).LongEntry[0], "LongEntryB");
ExitLongLimit(TargetPriceLong,"LongLimit","LongEntryA");
ExitLongStop(StopPriceLong,"LongStopA","LongEntryA");
ExitLongStop(StopPriceLong,"LongStopB","LongEntryB");
barResetUp = true;
}
I have placed an Aroon indicator on the chart. It is very clear that several orders are being placed even if the AroonUp does not have a value of 100. This tells me that there is something I have done wrong in the logic somehow.
Could somebody please take a look at this and see what may be going wrong?
Thank you for your help.

Comment