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

RE: [amibroker] Re: Nth Profitable Open



PureBytes Links

Trading Reference Links

Hi All,

 

While we’re on this subject I’ve been having problems with this logic since I started using AB and haven’t quite got round it yet.

 

E.g if I implement a simple n-bar stop using applystop function it works perfectly

 

Buy=1;

Sell=0;

Applystop(stoptypenbar,stopmodebars,3);

 

On my settings this would give me:

# of trades = 42823

Avg. bars held = 4.01

 

BUT

 

I try implementing the same logic through code without using applystop:

 

Buy=1;

Sell=barssince(buy)==3;

Buy=ExRem(Buy,Sell);

Sell=ExRem(Sell,Buy);

 

I would expect the same figures as above, however this time I get:

# of trades = 18

Avg. bars held = 820

 

I have also tried removing the exrem signals and replaced with equity(1): the results are different but still nowhere near the results given when using applystops.

 

Anybody can help point out what am I doing wrong??

 

Claude

 

 


From: hairy_mug [mailto:WSCHWARZ@xxxxxxxxxxxxx]
Sent: Wednesday, March 23, 2005 05:16
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Nth Profitable Open

 


This should do it;

Nth=3;
sell=barssince(c<ref(c,-1))>Nth;

walt
--- In amibroker@xxxxxxxxxxxxxxx, "billtex2003" <billtex2003@xxxx>
wrote:
>
> Is there any way to write a stop to exit on the Nth profitable open.
> After entry, I want to exit on the 3rd profitable open, for example.
> Thanks.





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







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 Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links