System Tester Problem w ATR Exits

kingie_d

Newbie
Messages
1
Likes
0
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)
 

Attachments

  • system 1.jpg
    system 1.jpg
    97.3 KB · Views: 347
  • system 2.jpg
    system 2.jpg
    23.3 KB · Views: 290
  • system 3.jpg
    system 3.jpg
    33.5 KB · Views: 319
kingie_d,

Try this formula and see if it makes any difference.

H>Ref(LLV(H+1*ATR(10),5),-1);
 
Top