Rank: Newbie
Groups: Registered, Registered Users Joined: 4/12/2012(UTC) Posts: 5
|
Hi,
I would like to create an enhanced tester that does the following: * Long Entry: when the 50 day SMA goes above the 100 day SMA
* Long Exit: when the 50 day SMA goes below the 100 day SMA OR the entry (open) price goes less than 4 times the last 5 day ATR
For Long Entry i have the following (on the Buy Order tab): * Mov(C,50,S) > Mov(C,100,S)
For Long Exi i have the following (on the Sell Short Order): * Mov(C,50,S) < Mov(C,100,S)
But how can i get the stop price in?
Thanks for all the advice,
Niall
|
|
|
|
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)
|
Have a look at your entry condition again. Consider the scenario that your LONG trade is exited through breach of the stop loss, on the very next bar your entry condition may still be true so the EST will open a new LONG position; is this how you trade? The exit code is fine as it will hold true until the next extry event. If not, then change the entry criteria to include a particular bar trigger event by using a Cross() function or other similar code. As for the stop. In the sell formula: Code:
entry:={your entry criteria};
exit:={your exit criteria};
stop:=H - 4*ATR(5);
stop:=HighestSince(1,entry,stop);
exit OR O<stop;
As you mention writing code in the BUY and SHORT SELL formual boxes, I am going to guess you want to test this as a swing trading system? If that's the case, you will need to complete all four trade critera, BUY , SELL, SHORT and COVER, with judicious use of strategic delays and maybe even some forward references if you need the EST to close and open positions on the same bar, there's lots written on the forum about different ways to achieve this aim. 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.