Rank: Member
Groups: Registered, Registered Users Joined: 10/1/2005(UTC) Posts: 13
|
Hi,
First Of all I do not know if this is possible within metastock but this is what I want to do.
part 1.
For use in a stop formula which is a modified timed stop.
Can I plot on the chart only after a certain date?
I want to input entry date on a daily chart and initial stop loss price.
Part 2
Can you count the bars since entry to use in the stop formula (from entry date)
The one thing I do not want to do is have it start from Nth expression because my entrys are not always at the exact signal and are usually after a additional confirmation. I also want to have it work in real time.
If one of the forum experts could point me in the right direction it would be greatly appreaciated and i will post the formula if it works how I expect.
Thanks Andrew
|
|
|
|
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)
|
Andrew
I think MetaStock can do everything you ask. Whether you can can get a handle on the different techniques reqired is another matter. This is not a put-down but a simple observation that it takes more than a few answers to questions on a forum to be come skilled in MetaStock.
A properly functioning timed exit (on that ignores secondary entry signals) requires a PREV-based latch. This device counts the bars since entry to determine the exit point.
{Timed Trade Exit}
D:=25; {trade length in bars}
N:=Fml("Entry Signal"); {entry}
X:=0; {independant exit signal}
Tr:=If(PREV<=0,N, {set with entry signal}
If( X {independant exit} OR
BarsSince(PREV=0)>=D, {bars since entry} {OR
any other entry related exit}
-1 {negative spike signals exit},
1)); {or trade continues}
X:=Tr<0; {exit bar}
X;
This is one form of the basic structure you will need for an on-chart stop. The System Tester can use the Simulation function for timing trades but that function is not available to other tools.
Plotting a signal only from a certain point is easy if you can define that starting point
ValueWhen(1, Cum("start signal")>0, "my plot");
A "date filter" formula might be helpful in this respect. The Date Range function from the Forum dll might be useful here also.
Hope this gives you something to work on.
Roy
MetaStock Tips & Tools
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 10/1/2005(UTC) Posts: 13
|
Thanks Roy
I will give this a look on the weekend and see If I can get a handle on it.
Your right I would not consider myself skilled in metastock code but still learning and hoping to get there.
Thanks again
Andrew
|
|
|
|
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.