Announcement

Collapse
No announcement yet.

Backtesting MACD EFS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Backtesting MACD EFS

    I'm trying to modify the MACD EFS (macdx-overband.efs) found on another thread for backtesting. First, I add a filter to the condition

    && ((vMACD1 > .25) || (vMACD1 < -.25))

    and that seems to work as far as limiting trades but it creates a new problem. Due to the filter, not all trades are closed before a new one in the same direction occurs. For example, system goes short, it would have gone long except for the filter, and then it goes short again. The result in backtesting appears to be two short positions. Can someone help me with this? When I try to fix I get extremes in both directions (no trades or thousands of trades).

    Thanks.
    Mark

  • #2
    Here is the solution...

    Here is what I would do....

    I would create a pre-condition to your entry trade conditions...

    Like this...

    if ((!Strategy.isInTrade()) || (Strategy.isShort())) {

    look for buy entry signals and execute the trades.

    }

    if ((!Strategy.isInTrade()) || (Strategy.isLong())) {

    look for Sell entry signals and execute the trades.

    }

    This should solve the problem.

    Brad
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Oops. Forgot the parenthesis. Thanks.

      Comment

      Working...
      X