The code is working and my Entries are correctly triggered when my (upTrend) criteria is met.
But, if I go long the trend and that trend ends while still in my trade, my strategy won't exit until the next upTrend starts and the exit criteria is met during the new trend.
Conversely, if a trend starts while I'm in a position triggered by my normal trading criteria, the (upTrend) exit rule kicks in. How can I keep these two rule from overlapping?
I know it's something simple but I can't think through it. Here is my trend code:
//****Trading During Uptrend****
if (upTrend)
{
if (DoubleStochastics(DD).K[0] > DoubleStochastics(DD).K[1])
{
EnterLong(DefaultQuantity, "Trend Up");
}
if (Momentum(Sell)[0] < Momentum(Sell)[1])
{
ExitLong("DownDay","Trend Up");
}
}
Comment