Rank: Member
Groups: Registered, Registered Users Joined: 2/15/2010(UTC) Posts: 14
|
Hi,
I would like to know if Metastock language can accommodate the following;
My trend-following sytem has a profit target as a standard exit. What I would like to do if my intra-trade proft % reaches a certain level then lock in some profit by reducing the trade size to the original entry size. For example, if I had a $20K position size at entry and the stock had risen 50% to $30K, then the idea would be bank the $10K and have the trade reset to a $20K size and let it continue to run until my exit rule triggers a trade closure.
Any code to reflect this scenario would be much appreciated.
Slipstream
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Can take-partial-profits by scaling out of a trade be done in MS code? Maybe? Can it be done easily? No.
For indicators and explorations, it's pretty easy to code the scale-out triggers, but unfortunately the EST doesn't let you scale out of positions. What you will need to try is to code multiple trades to be taken when the entry condition is met (which is going to require some workarounds to achieve, either forward referencing or backward referencing with corresponding trade delays in the settings because the EST will only take one trade per bar). You'll then need to code two exit conditions, one for the "normal" exit trigger which will close both trades and one exit trigger for the scale-out which will only close the take-partial-profits trade (you'll have to figure a way for the EST to remember which trade is which too!)
This might be one of the many instances where you'll probably be better off writing your own application, or use something like Excel in lieu of the limited capabilities of the MS EST.
Good luck.
wabbit [:D]
|
|
|
|
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.