Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 5/27/2013(UTC) Posts: 2
|
This should be simple, but I can't figure it out. I want a simple 2% trailing stop based on the highest stock price since I entered a long trade. So if I buy a stock at 90 and it goes up to 100, the stop should be 2% below 100, or a stop of 98. If it goes up to 110, the stop should be 2% below 110 or a stop at 107.8.
I've been using this formula, but the problem is, if there is more than a 2% move in a day, it will stop me out on the day of a large rally.
perc:=2; loss:=H*perc/100; trail:= If(C>PREV AND Ref(C,-1)>PREV, Max(PREV,H-loss), If(C<PREV AND Ref(C,-1)<PREV, H-loss, If(C>PREV,C-loss,C+loss))); Trail
It seems there should be an easy formula for a trailing 2% stop. Anybody have any ideas?
|
|
|
|
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 maker
Here's a simple trailing stop format for the long side. You can change prices to suit. When you talk about "highest price" it's not clear to me whether you mean CLOSE or HIGH, so make changes as necessary. The Ref() function in the last line provides visual feedback of the stop being broken. Hope this helps.
{Trailing Stop Long} perc:=2.0; Trail:=C*(100-perc)/100; Stop:=If(C>=PREV,Max(Trail,PREV),Trail); Ref(Stop,-1);
Roy
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 5/27/2013(UTC) Posts: 2
|
Roy, sorry for being away for so long. This is great. Thanks so much.
|
|
|
|
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.