[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: exit help required



PureBytes Links

Trading Reference Links

Applystop for stoploss and trail stop works on the basis of the Low price crossing a value that is the highest high since buy less a certain value. (assuming a  long position). ie pull back value
You have used Cross as the value of the trail exit, so the applystop will exit when low crosses below highest high since buy less 1 point
ApplyStop(2,2, Cross(Ref(LLV(Low,5),-1),Close),0); in this the trail stop value is either 0 or 1 and really makes no sense
 
just use Sell = Cross(Ref(LLV(Low,5),-1),Close); not applystop
 
On 8/24/05, Terry <MagicTH@xxxxxxxxxxx> wrote:

I think you need to rework some of your statements since Cross(x,y) will only result in a 1 or 0 (True or False) and it appears you are assuming it results in a price. There are two places noted by red text.

 

It's possible in your ApplyStop case that you just want a 1 point stop, but you are probably getting either a 0 point stop or a 1 point stop by using the Cross function there depending on the truth of the Cross().

 

If you want a stop at a certain price I think you need to convert it to points instead of an absolute price.

--

Terry

 

| -----Original Message-----

| From: amibroker@xxxxxxxxxxxxxxx [mailto: amibroker@xxxxxxxxxxxxxxx] On

| Behalf Of pennellp2000

| Sent: Tuesday, August 23, 2005 16:49

| To: amibroker@xxxxxxxxxxxxxxx

| Subject: [amibroker] Re: exit help required

|

| Terry,

|        I have tried both Applystop and AFL seperately as below. Both

| methods seem to give different exits to my manual backtesting

|

|

| Method 1 using AFL.

|

| Cond1 = Cross(Ref(LLV(Low,5),-1),Close);

| Cond2 = ValueWhen(Buy,BuyPrice) - 1.6*ATR(30);

| Sell = Cond1 AND Cond1 > BuyPrice OR Cross(Cond2,Close);

| // Cond2 is my max stop loss//

|

| Method 2 using Applystop

| ApplyStop(2,2, Cross(Ref(LLV(Low,5),-1),Close),0);

| ApplyStop(0,2,2*ATR(30),0,True,True);

|

 



Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software Stock investment software


YAHOO! GROUPS LINKS






--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





YAHOO! GROUPS LINKS