Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/13/2005(UTC) Posts: 87 Location: perth australia
|
HI all,
This is too difficult for me to work out.
x:=entry signal
y:=trailing stop
z:=exit signal
If I enter a trade I want to get out if my trailing stop is broken within the first 5 bars of my entry signal. If it is broken after the first 5 bars following my entry signal and my exit signal has not been given, then I do not want to get out until my exit signal is given regardless that my trailing stop has been broken. The other provision is that, if following my entry signal my exit signal is given without the trailing stop being broken, then I exit.
Any help appreciated :)
Cheers
Norman
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 8/16/2005(UTC) Posts: 1 Location: Perth, Western Australia
|
Try this
x:=Entry Signal;
Exit1:=Barssince(X)<=5 and Trailing Stop;
Exit2:=Barssince(X)>5 and exit signal ;
Exit:=Exit1 or Exit2;
Regards,
Tim.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/13/2005(UTC) Posts: 87 Location: perth australia
|
Hi tim,
I have tried that already but unfortunately it does not work.Any ideas?
Cheers
Norman
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 1/13/2005(UTC) Posts: 87 Location: perth australia
|
Hi
I think the problem is my trailing stop. I have to enter my entry signal into the trailing stop. My entry signal uses Patrick's latch dll so I have an exit signal incorporated into my entry signal. So whenever I try to achieve what the above conditions MS say there is a circular reference nestled in the formulae. Any way round this?
Cheers
Norman
|
|
|
|
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 Norman
For a number of reasons I think you should be using a PREV-based latch as part of your trailing stop. A simple latch, dll based or otherwise, is not capable of properly managing any exit that's related to some aspect of the entry (time, price, indicator or whatever).
You could look at Richard Dale's trailing stop dll but I'm not sure if you can use a timed exit with it. Check it out anyway.
As a rule of thumb you can expect a PREV-based latch to have 2 PREVs for the first exit condition and one more PREV for each additional exit condition. Independant (of entry) exit conditions don't need a PREV and can be inserted into a PREV latch with no extra overheads being incurred.
The November issue of MSTT touches on some of these issues so you might pick up some more ideas there. You know my email address if you need further help.
Roy
MetaStock Tips & Tools
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 11/10/2005(UTC) Posts: 4
|
A few daya ago I downloaded Richard Dale's DLL.
It works great as an indicator.
But I don't know if and how I can use it in the system tester?
Can anyone help how to do this?
Thanks.
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 11/23/2006(UTC) Posts: 3
|
I'm trying this as well. I'm also fairly new to MS (~10 weeks) so still grapplling with the language.
The indicator part is great and just what I wanted. Now I'm doing an expert as a preparation to a system for backtesting. My reason is that I want to exit on set stops related to performance of this trade, not on conditions specifically related to the original entry conditions
The key seems to be setting the Stages and I keep getting errors message when I try to do this explicitly eg
Buy in Expert is
ExtFml("AdvancedStop.stagelong",0,0,0,0,0,0,0,0) = 0 AND ..rest of the buy signal...; ExtFml("AdvancedStop.stagelong",0,0,0,0,0,0,0,0) = 1 to try show we're in a trade - but this vives an assignment error.
(zeroes there just to try and get something going!)
Anybody else having a go at this?
|
|
|
|
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)
|
I am not entirely sure how Richard Dale wrote his code, but I will take a guess that he has internally set the error condition at the start of his code block in the .dll file (this is good coding practice) so by the user not providing any input arguments i.e. 0,0,0,0,0,0,0 etc there is no condition for the function to evaluate, therefore no opportunity to reset the error condition and return a value to the user. Try using real data as a real user might and you will see the function works fine. See Richard's website for more help : http://www.tradernexus.com/advancedstop/advancedstop.html
|
|
|
|
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.