Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/25/2005(UTC) Posts: 23 Location: Melbourne, Australia
|
I have MetaStock V9.1 EOD. I'm setting up a system test where a trade is opened the day after a signal at a limit price, and closed when a target
is reached. The buy order (long) is working ok, but I can't seem to get it to sell if the target price is reached on the same day as the entry. It always closes the trade the next day at the open. I have selected "realistic market prices" but it still closes the next day. Can this be done with the EOD version?
Cheers
Charmeta
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Charmeta
Yes it can be done.
Use a forward reference for your Buy Order code (and Price code too if that's how you are defining entry price), and then apply a Strategic Delay of 1 bar to the Buy order.
That allows the Enhanced System Tester to "Consider" the order 1 bar prior to when it thinks it will be executed, then Execute the order on the correct day. The Sell Order remains as is and has neither a forward reference nor a delay applied.
I've explained this process more fully in a couple Of MSTT articles, and I can assure you that it does work. I think the problem is that the EST WILL NOT "Consider" a Buy and a Sell on the same bar, but it can certainly be tricked into executing on the same EOD bar.
{Buy Order}
Ref(Fml("My Buy Signal"),+1);
{Price}
Ref(Fml("My Buy Price"),+1);
Strategic Delay (bars); [1]
{Sell Order}
Fml("My Sell Signal");
Strategic Delay (bars); [0]
Set the Simulation Buy Price to OPEN and Delay order opening to 0.
Roy
MetaStock Tips & Tools
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/25/2005(UTC) Posts: 23 Location: Melbourne, Australia
|
Thanks mstt, it's working!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Charmeta
Using a forward reference means that the last bar of data won't be tested, but that's hardly going to make a significant difference to your results.
Roy
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/25/2005(UTC) Posts: 23 Location: Melbourne, Australia
|
Hi Roy, I'm still fiddling with it. My system derives the entry price on the signal day, but the target is calculated using the actual entry price. My formula includes the condition that if the stock opens lower (for longs) than the system entry price, the open will be used to derive the target & stop.
I think this is throwing out the results as I'm now getting incorrect entry prices in the results orders screen. At the moment I have references in the entry signal formula as well as the system test, and I'm going around in circles trying to figure it out!
Perhaps I should remove any ref's in the signal?
Here is how I've obtained the actual entry price:
If the open on the entry day is < the system entry price derived from the signal day, use the open, else use the system entry price.
Can you see a problem with this?
Cheers
Charmeta
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi Charmeta
I can't see a specific problem with what you're doing, but then I suspect the problem is somewhere among all the stuff that you're not telling me. That's normal. I don't have the full picture of what you're doing so I don't yet know what questions to ask, and certinly not the right answers.
If you'd care to send me the system test that you have so far, as exported from MS and including any custom formulas, then I'd be happy to try and work out what needs to be changed. I'd also need a fuller explanation of what you're attempting to do with the system.
No, I won't steal your custom formulas or ideas if that's a concern. Working with only some of the facts is not only harder but it means that a resolution is less likely too. If you'd like further help then write to me directly at rlarsen@man.quik.co.nz . If I can't fix your problem (and I'm reasonably confident that I can) then at least i should be able to explain why what you're trying to do won't work. However, finding out why something doesn't work is usually the first step in coming up with a work-around that does.
Roy
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 9/25/2005(UTC) Posts: 23 Location: Melbourne, Australia
|
Thanks Roy. I've had another look at my custom entry price fomula with a fresh mind & I've simplified it. I was fairly tired when I was going around in circles, but now I see it more clearly.
Will let you know how it goes.
Charmeta
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.