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

[amibroker] Tomasz - Re: Limit Trade Length by Number of Bars



PureBytes Links

Trading Reference Links


Dear Tomasz, 

Fellow AB Forum members have kindly offered suggestions to my problem 
but it has not been resolved.  I was wondering if you might give this 
problem some thought.

It seems to me that the N-Bar stop feature in AB might have a bug, or 
perhaps I am doing something wrong.  I have tried suggestions made 
recently by other members but somehow I am not getting any difference 
in my results.  (To see the code I am running please refer to 
previous posts made by me under the title 'Limit Trade Length by 
Number of Bars').  In my attempts to resolve my problem I have tried 
the following steps: 

1. I placed the line ApplyStop( stopTypeNBar, stopModeBars, 50 ); 
right after the 2 'stop' lines in my code and submitted the code; many
trades still run much longer than 50 Bars. 

2. I ran the code with the line above placed IN FRONT OF my 2 'stop' 
lines in my code and submitted the code; the result is the same as run
(1). 
  
3. I enabled the N-bar stop by clicking the 'bars' radial button and 
typed 50 in the Bars box and ran the code; again, same result as run 
(1). 

I would like to clarify the problem I am encountering by showing you 
some of my output results.  The following shows 15 lines of output
results, sorted by #bars in descending order (1 heading line and 14 
lines of actual data).  I have omitted certain columns because they 
are irrelevant: 

Ticker Trade                Date            Price      Ex. date     
Ex. Price   Profit          # bars
 
CTRA  Long (profit)    11/13/1998   6.8438   2/3/2000     35.00       
4,519.15      320 
ECPG Long (profit)      8/7/1998     3.5313    7/9/1999      
9.13        1,938.20      241 
MBLA  Long (n-bar)     3/5/1997      6.8175    7/8/1997      
6.75           -25.21        90 
AVD    Long (n-bar)     1/23/1995    1.8783    5/25/1995    
1.75           -43.17        87 
PEX    Long (n-bar)      8/19/1999   6.25       12/9/1999     
6.00           -64.25        81 
CRRC Long                11/10/1997  8.6667    2/20/1998    
8.07         -105.85        75 
CNBC Long (n-bar)       4/23/1998  8.227     8/4/1998      
6.68          -297.82        74 
CRED Long (n-bar)       2/2/1996    0.9375   5/15/1996    
0.97             13.59        72 
CLFC  Long (n-bar)       6/13/2002  6.4815   9/18/2002    
6.00          -506.42        68 
PTEN  Long (n-bar)     11/1/1994    0.9844   2/3/1995      
0.75          -129.32        66 
DCAI   Long (n-bar)       1/27/1999  0.6094   4/27/1999     
0.64            36.48        65 
AVD    Long (max loss)  8/4/1997   2.5482   10/30/1997   
1.91         -338.26        64 
IPAR   Long (n-bar)      11/17/2000 5.9167   2/20/2001     
6.08             77.46       64 
CW     Long (n-bar)     10/24/1994  8.95315 1/23/1995     
8.88           -18.30        63 

As you can see, the 1st two lines, CTRA and ECPG, exit for Long 
(profit) reason, which means because of the ApplyStop (1, 1, 90, 1) 
code for target profit.  The next 3 lines show exit for Long (n-bar) 
reason, which means because of the code ApplyStop( stopTypeNBar,
stopModeBars, 50 ) for 50-bar limit.  The remaining 9 lines show exit 
for reasons of MFI crossover at 80, 50-bar limit, stop loss 25%, and
50-bar limit. 

It is immediately obvious that the 50-bar limit is not controlling 
the exit, or perhaps it is not working properly --- maybe there is a 
bug?  Or perhaps I am not setting it up correctly? 

Can you please check the possibility that AB's N-Bar stop is not 
overriding the other stops, i.e. maybe there is a bug? 

Thank you. 

Josef 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/