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

RE: [EquisMetaStock Group] Re: Coding request



PureBytes Links

Trading Reference Links

Hi Roy

 

Thanks for your response, it has given me something to think about and I
will go back over everything you have said and work it through till I am
satisfied that I understand.

 

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 starting
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?).

 

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.  Using the simplified
version, I will not get the two week buffer, will I?  It is possible that
the closing price will cross the EMA on the first week of its uptrend.

 

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

 

Regards

 

John 

 

  _____  

From: equismetastock@xxxxxxxxxxxxxxx [mailto:equismetastock@xxxxxxxxxxxxxxx]
On Behalf Of Roy Larsen
Sent: Wednesday, 8 November 2006 12:04 PM
To: equismetastock@xxxxxxxxxxxxxxx
Subject: Re: [EquisMetaStock Group] Re: Coding request

 

Hi John

I thought my reply yesterday would have given you enough information to come
up with a simpler formula such as the one that follows. I apologise if I did
not give sufficient information.

C>Mov(C,30,E);

Putting your formula aside for a moment let's just work from your stated
conditions. I'm not going to try and second-guess what you really meant if
it is something different from what you said.

"If the closing price crosses above the 30 week EMA or is already above the
EMA, and the EMA has turned upwards, then....."

You can use the knowledge that an EMA ALWAYS heads towards the price to
deduce the following points.

1. If C crosses above its 30-period EMA then C must now be higher than the
EMA.
2. If C is higher than its 30-period EMA it must have crossed above C at
some previous point.
3. If C is higher than its 30-period EMA it must have turned upward when C
crossed above the EMA.

I suggest that "C>Mov(C,30,E)" meets all your stated conditions and the
extra code you have added is either redundant or contradictory.

The last two lines of code are out of place and would be more appropriate
(with one bar less delay) in picking the point at which an SMA turned
upwards. Picking the point at which an EMA turns upwards is derived from
Cross(C,Mov(C,30,E)), which is consistent with my earlier statement that "an
EMA ALWAYS heads towards the price".

I think it would be helpful for you if you checked my suggestions using the
Indicator Builder and a chart or two. Separate out each expression and
compare binary plots against what you see happening with the price and
moving average. There's no substitute for checking results visually, and
taking the time to figure out what appears to not make sense.

Hope this helps more than my previous offering.

Regards

Roy
www.metastocktips.co.nz

----- Original Message ----- 
From: johnnic1948 
To: equismetastock@ <mailto:equismetastock%40yahoogroups.com>
yahoogroups.com 
Sent: Wednesday, November 08, 2006 10:36 AM
Subject: [EquisMetaStock Group] Re: Coding request

Does anyone have any helpful suggestions?

--- In equismetastock@ <mailto:equismetastock%40yahoogroups.com>
yahoogroups.com, "johnnic1948" <johnnic@xxx> 
wrote:
>
> Would someone please be kind enough to confirm that the following 
> simple code does what I want it to do?
> 
> If the closing price crosses above the 30 week EMA or is already 
> above the EMA, and the EMA has turned upwards, then.....
> 
> The code I have written is:
> 
> (Cross(C,Mov(C,30,E)) OR C > Mov(C,30,E)) 
> 
> AND
> (Mov(C,30,E) > Ref(Mov(C,30,E),-1) 
> 
> AND
> Ref(Mov(C,30,E),-1) > Ref(Mov(C,30,E),-2) 
> 
> AND
> Ref(Mov(C,30,E),-2) < Ref(Mov(C,30,E),-3));
> 
> Even if it is correct, is there a more elegant way of achieving 
the 
> same end?
> 
> Thanks
> 
> John
>

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

 



[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/