having problems setting-up a strategy, would appreciate some simple feedback on how to implement what I am missing.
after going long I want to separate when to use Condition 2 or Condition 3 to close the trade.
the idea is, if since the last Long trade was opened:
- ADX(14) NEVER crossed above 35 only Condition 2 should apply to close the trade and all condition 3 signals should be ignored;
- ADX(14) crossed above 35, at least once since trade is open is enough to activate this rule, Condition 3 should apply to close the trade and all condition 2 signals should be ignored;
I understand I should probably use a bool variable to do this but never used before and I am having problems to apply such filter.
below a simplified sample of what I have:
// Condition set 1
if (Condition to go Long)
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (CrossBelow(Stochastics(3, 10, 3).D, 80, 1))
{
ExitLong("", "");
}
// Condition set 3
if (CrossBelow(Close, KAMA(Low, 2,5, 30)[5], 1))
{
ExitLong("", "");
}


Comment