in Search

Backtesting help needed

Last post 06-18-2009, 7:23 by Damien. 0 replies.
Sort Posts: Previous Next
  •  06-18-2009, 7:23 29938

    Backtesting help needed

    Hello,

     

     I am new to MetaStock and I don't know how to create a backtesting script....It consists of 2 moving averages cross over, one stop loss and one profit stop.  Can someone please help me develop a back testing script as per below?

     

    Entry:

    Long-MA(fast) crosses above MA(medium) & close price above MA(slow).Open on the next bar at market open..

    Short-MA(fast) crosses below MA(medium) & close price below MA(slow). Open on the next bar at market open.

     

     

    Exit:

    Long - MA(fast) crosses below EMA(medium). Exit on the next bar at market open.

    Short- MA(fast) crosses above EMA(medium).Exit on the next bar at market open.

     

     

    I need to be able to set up the values for all 3 moving averages (ie 10 bars, 30 bars, 200 bars)

     

     

    Stop loss:

    Long- N x ATR(X) below entry price

    Short-N x ATR(X) above entry price

    ATR is calculated on entry signal day (1 bar before entry).

     

    Profit stop:

    Long- M x ATR(X) above entry price.

    Short- M x ATR (X) below entry price

    ATR is calculated on entry signal day (1 bar before entry).

     

    I need to be able to set up values M, N and X.  M & N multipliers containing 2 decimal points.  X is a whole number determining the period over which the ATR is calculated  (ie if N =2 & X = 20, that means I need the value for 2xATR(20), or  2x ATR over 20 bars.

     

    Time stop: close position K bars after open – using the open price on the Kth bar after entry.

    I need to be able to set up the number K – a whole number.

     

    Regards

    Damien
View as RSS news feed in XML