logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Gerrit  
#1 Posted : Tuesday, April 26, 2005 5:47:31 PM(UTC)
Gerrit

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/18/2005(UTC)
Posts: 25

Hi Hopefully someone has done this before. I want a very simple exit strategy that shifts my exit stop up each time we cross 10 more points profit. So if our points profit on a deal initially goes above 10, I want my stop set to 10 so that if the profit comes back to 10 I exit. If the profit however goes even further to above 20, I want to set the stop to 20 and so the game continues until the trend is reversed and I walk away happy with my stash. It is vital to test my exit strategy so I know whether I am letting my profits run. Any ideas? Thanks Gerrit
Patrick  
#2 Posted : Wednesday, April 27, 2005 10:39:48 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
[color=red:35d9861f90]Warning - I did this in 5 minutes ....[/color] Make sure to double check the results etc .... bc:={your buy condition here}; rv:=Round((C-ValueWhen(1,bc,C))/10); mu:=If(RV<1,0,rv); lvl:=ValueWhen(1,bc,C); If(bc,lvl,If(ROC(mu,1,$)>0,lvl+(10*mu),PREV)); It's not pretty but it should return the stop line, then exit signal would be : bc:={your buy condition here}; rv:=Round((C-ValueWhen(1,bc,C))/10); mu:=If(RV<1,0,rv); lvl:=ValueWhen(1,bc,C); lin:=If(bc,lvl,If(ROC(mu,1,$)>0,lvl+(10*mu),PREV)); Cross(lin,C) Etc ... Patrick
Gerrit  
#3 Posted : Thursday, April 28, 2005 6:53:02 PM(UTC)
Gerrit

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 4/18/2005(UTC)
Posts: 25

Hi Patrick Thanks a lot for the help with this. At first I was a bit stumped but I figured out you're just coding a sell order condition and not actually putting anything in the separate stop function window. Your attempt was good but did not entirely pull off what I wanted. Below is what I did to it now and I think based on your feedback on other posts I hopefully spead the test up a lot by removing the PREV and roc functions. Might still need some tiny tweaks but the results and examples I checked out shows it is working now. Thanks a lot!! :D Gerrit entry := Cross(Mov(C,opt1,E),Mov(C,opt2,E)); lvl := ValueWhen(1,entry,C); rv := int((C-lvl)/10); mu := If(rv<1,0,rv); lin := If(C <= lvl,(lvl - 10), lvl+(10*mu)); Cross(lin,C)
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.