Need some Metastock formula help

skintboy

Newbie
Messages
5
Likes
0
Howdy,
I'm trying to write a Metastock system test formula for a trend following system.

Buy - DMI Cross, price > mov av 50 and high > yesterdays high.

Stop > price < yesterdays low

No problem with the buy but cant seem to setup the correct stop.

Would appreciate some help in this department..

Cheers,
Taff.
 
Howdy,
I'm trying to write a Metastock system test formula for a trend following system.

Buy - DMI Cross, price > mov av 50 and high > yesterdays high.

Stop > price < yesterdays low

No problem with the buy but cant seem to setup the correct stop.

Would appreciate some help in this department..

Cheers,
Taff.
Hi Taff,

I assume that "price" means "close", so here it goes:
C<Ref(L,-1).
Hope this helps.

Eduardo.
 
Hi Taff,

I assume that "price" means "close", so here it goes:
C<Ref(L,-1).
Hope this helps.

Eduardo.

I have tried that but it doesnt work properly. On expert advisor it puts the stop in at every bar and in the system tester it doesnt terminate on the correct bars.

Any other hints????
 
I have tried that but it doesnt work properly. On expert advisor it puts the stop in at every bar and in the system tester it doesnt terminate on the correct bars.

Any other hints????

As you can see in the attached chart its real messy and incorrect. It seems to keep taking trades way after the dmi cross as well. Not sure why..
 

Attachments

  • ADM.JPG
    ADM.JPG
    154.5 KB · Views: 5,615
As you can see in the attached chart its real messy and incorrect. It seems to keep taking trades way after the dmi cross as well. Not sure why..
OK,I guess I don't understand what do you mean by "Stop > price < yesterdays low", so I'll assume that what you want is to close your position when the intraday price falls below yesterday low, right? Here we go:

1.In the Sell Order tab on the System Editor, go to "Order type" and select "Limit" (or was it "Stop"? Don't remember; anyway, select "Limit" for now).

2.Enter the following formula in the "Limit or Stop Price" window:

If(L<Ref(L,-1),Ref(L,-1),0).

This window only accept binary code; another way is to write the above code in an indicator, say, "Exit", and then write in the big "Formula" window:

Fml("Exit")

while living the default "Market" order; however I am not sure if this will work - I had to write all sort of funny latches to make it work in that window the way I wanted to.
Try first using limit orders, and see what happens.

Eduardo.
 
OK,I guess I don't understand what do you mean by "Stop > price < yesterdays low", so I'll assume that what you want is to close your position when the intraday price falls below yesterday low, right? Here we go:

1.In the Sell Order tab on the System Editor, go to "Order type" and select "Limit" (or was it "Stop"? Don't remember; anyway, select "Limit" for now).

2.Enter the following formula in the "Limit or Stop Price" window:

If(L<Ref(L,-1),Ref(L,-1),0).

This window only accept binary code; another way is to write the above code in an indicator, say, "Exit", and then write in the big "Formula" window:

Fml("Exit")

while living the default "Market" order; however I am not sure if this will work - I had to write all sort of funny latches to make it work in that window the way I wanted to.
Try first using limit orders, and see what happens.

Eduardo.


Still does seem to work correctly.
On the buy and sell it seems to take this option many days after the dmi cross and the stop option is all over the place.

Any other options i can try?
 

Attachments

  • adm2.JPG
    adm2.JPG
    168.7 KB · Views: 13,191
Still does seem to work correctly.
On the buy and sell it seems to take this option many days after the dmi cross and the stop option is all over the place.

Any other options i can try?
I thought you had no problems on the "buy"; have you changed your order? I mean, from "market" to "limit"? You are supposed to do that only when closing the trade, as you stated that you were satisfied with your opening orders. Have you checked this?

Eduardo.
 
I thought you had no problems on the "buy"; have you changed your order? I mean, from "market" to "limit"? You are supposed to do that only when closing the trade, as you stated that you were satisfied with your opening orders. Have you checked this?

Eduardo.

All orders are set to market at present. I dont know what the limit orders do or how to use them to be honest.

Upon checking the charts more closely some buy/sell orders are at the correct point and others seem to be taken many days after and not at the correct place.

So whats the best way to apply this?
 
ZEPPO... Will You Help Me Create This Formula?

Hi Mr Zeppo,

Will you help me create metastock formula, the expert advisor (buy and sell signal) and the explorer with this condition,

I buy if : todays Pivot {(H+L+C)/3} above 1 % of yesterday's pivot or
if todays pivot is already 1 % above the last lowest pivot(after the swing) or
if todays pivot is already 1 % above the last 3days pivot average

I Sell if : todays pivot is 1% below yesterdays pivot or
if todays pivot is already 1% below the last highest pivot(from the last swing) or
if todays pivot is already 1% below the last 3days pivot average



Please Mr Zeppo create for me.

Really Thank You Mr Zeppo

If you dont mind, would you send it to my email : [email protected]

I realy appreciate it

Thanks
 
Top