Rank: Newbie
Groups: Registered, Registered Users Joined: 3/27/2008(UTC) Posts: 2
|
Hi people, I have only just joined this forum and hope someone can help me.
I am trying to make up a system tester and I've put in Long Buy and Short Sell orders which are working as advertised in the tester. However, for the exits, I am trying to use a trailing stop of 1 ATR away from the highest low (for longs) and lowest high (for shorts). Here is the formula for the ATR BAND (light blue bands in pic) indicator which gives me the bands so I can manually trail the stop:
stdha := Mov(H,1,E)+1*(ATR(10)); stdla := Mov(L,1,E)-1*(ATR(10)); stdha; stdla
So using those bands, I am trying to set my sell order formula (for longs) and buy to cover shorts (for shorts).
I'll use BOL with a short order as an example If (in real life) I was to set an auto stop at the band, and trail it down (but never up)as the days go, then I would be stopped out if on a day where the high was higher than the band/stop. So I figure that to code this into the system tester I would use the formula which is in the pic: H>LLV((Mov(H,1,E)+1*(ATR(10))),5)
eg. close position if the HIGH is greater than the LOWEST LOW VALUE of "THE UPPER ATR BAND" of the last 5 days.
I used 5 days because I wasn't sure how to make it start trailing from when the position was opened.
But as you can see in these pics, a short position was opened the day after the stochastic cross (as per the short formula) - BUT - the system closed the position the next day (6/22/2007) which it should only do if there was a trigger the day before. You can see in the pic that the high is way below the upper atr band (and even the lowest low of that band for the last 5 days) so why I ask you, did it trigger to close the position.
Can someone help me to rearrange my close position formula to match the intended purpose. I look at the formula I have worked out for it, and it seems to make sense to me! (except maybe the five day thing - if anyone can help to make it start when the position is opened then that would be great too)
|
|
|
|
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)
|
kingie,
in continuation of the posts in other places....
You can either use the Forum.latch or the Fourum variable LLV functions, or even Richard Dale's Advanced Trailing Stop library.
Hope this helps.
wabbit [:D]
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 3/27/2008(UTC) Posts: 2
|
|
|
|
|
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.