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

Re: [EquisMetaStock Group] Re: Coding request



PureBytes Links

Trading Reference Links

Hi John


> Interestingly, I ran both formulas (ie my convoluted one and your simplified version) through Metastock Explorer and then undertook a 5000 Monte Carlo exploration with TradeSim for the top 200 Aussie stocks, with a tarting
capital of $100k, over the period 1 Oct 2001 till today. The results were as follows:

> Simplified version - Max profit - $221k; Average profit - $91k; Min profit - minus$9k

>My original version - Max profit - $284k; Average profit - $130k; Min profit - $52k

> This suggests to me that the extra code is not fully redundant. When I set both up as Experts, I get significantly different indicators. One obvious difference is that with the simplified version I get buy signals whenever
the closing price is above the moving average which will be every bar while ever the stock is trending upwards. I don't want this, (although I assume there is some way that I can tell Metastock that once a signal has been
given once, I don't want it repeated until a sell signal has been received?).

The redundancy I noted was only in terms of the conditions set out in your last post. There may have been other conditions included in your original post but I didn't refer back to that (silly me - it's long since lost). I wasn't trying to rewrite your system, just to show you that one short expression comparing price to an EMA tells us more about what the EMA is doing than is immediately apparent.

> Also, I want to be certain that the trend has reversed and looks like it is sustainable, hence the code that looks for a downward EMA followed by two weeks of upwards EMA, ie a turning of the EMA.

OK, then the summing method that Jose mentioned (checking that X contiguous Closes are above the EMS) is as good a way as any to verify that. 

> Using the simplified version, I will not get the two week buffer, will I?

No, no buffer at all. That aspect got lost in translation somewhere.

> It is possible that the closing price will cross the EMA on the first week of its uptrend.

That depends on how you define "uptrend". All I can tell you for sure, and this goes back to my observations about the characteristics of an EMA, is that if the EMA just turned up then the price just crossed above the EMA. This fact has nothing to with an EMAs reliability in determing a trend - it's purely about the mathematics of how an EMA is constructed. It's mathematically impossible for an EMA to move away from price by heading in the opposite direction. No exceptions. The new data added on each bar ensures that there's always a bias towards price. 

{Exponential Moving Average}
Pds:=Input("Periods",1,1000,30);  
Rate:=2 / (Pds+1);
If(Cum(1)=1, C, PREV*(1-Rate) + C*Rate );

> I'm not arguing here, I'm just asking. I appreciate you taking the time to help me.

Not a problem. In spite of what anyone might say, "the only dumb questions are the ones you don't ask".


Regards

Roy

[Non-text portions of this message have been removed]



 
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/