in Search

Bars to establish moving avg delays initial entry - invalidates buy & hold comparison.

Last post 06-26-2009, 18:19 by wabbit. 1 replies.
Sort Posts: Previous Next
  •  06-26-2009, 18:03 30005

    Bars to establish moving avg delays initial entry - invalidates buy & hold comparison.

    How can the system test start with an already established 34-month moving average? Waiting for the 34-month moving average to become established delays the first entry at least that many bars. Yet, buy & hold  performance comparison includes that first 34 bars in which I can't establish an entry. This makes it very difficult to make a valid comparison between my trading performance and the buy & hold performance. Any solutions to this delima?
  •  06-26-2009, 18:19 30007 in reply to 30005

    Re: Bars to establish moving avg delays initial entry - invalidates buy & hold comparison.

    Hi smackdabble,

    Welcome to the forum.

    Try writing another test where the entry criteria is:
    Code:
    {if the next bar is the first bar when the moving average is defined, enter at OPEN}
    ma:=mov(c,34,s);
    ref(cum(isdefined(ma)),+1)=1;


    Have a look in the MS Users Manual for what each function component does.  Depending on the specifics of how you want to do the comparison, the forward referencing may not be necessary, but it is if you want to enter at the OPEN of the first bar in the period and exit at the CLOSE of the last bar.



    Hope this helps.

    wabbit Big Smile [:D]

    P.S. You could adapt this concept to be run in an exploration, but try running the new benchmark EST first.

    "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim."
    Edsgar W. Dijkstra

     

    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC C, 11 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status :
    My SkyPE account : wabbit.com.au

View as RSS news feed in XML