[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Interpretation of Formula



PureBytes Links

Trading Reference Links

I was wondering if anyone can help me decipher the following formula 
for a system backtest. The formula is:

target:=1.0;
pt:=Trough(1,Security("SPY",c),target);
time:=TroughBars(1,Security("SPY",c),target);
signal:=Cross(((Security("SPY",c)-pt)/pt)*100,target);
signal AND (Ref(BarsSince(signal),-1)>=time)

The concept is that the above formula will purchase a selected 
security at such time as the SPY increases at least 1% above its 
most recent trough. 

The sell side of the formula is:

target:=1.0;
pt:=Peak(1,Security("SPY",c),target);
time:=PeakBars(1,Security("SPY",c),target);
signal:=Cross(Neg(target),((Security("SPY",c)-pt)/pt)*100);
signal AND (Ref(BarsSince(signal),-1)>=time)

In the above formula, the sell signal is suppose to occur when the 
SPY closes 1% below its most recent peak.

For the most part, it appears that the signals are correct but when 
I run this in Metastock Pro 8.0, I am not catching all the signals.  
Perhaps I am missing something or have too much in the formula.

Can anyone with some programming assistance let me know if this is 
programmed properly?

Thank you.

Mike



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/