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

Re: [amibroker] Odd BarsSince behavior



PureBytes Links

Trading Reference Links

I've always found filtering on buy OR sell confusing. Better to just filter on sell and use 
ValueWhen to get your buy info.

Andy Watts wrote:
> Hi,
> 
> Any help explaining the strange output from the simple code below
> would be very much appreciated.  :)
> 
> It should exit after 10 bars.
> Strangly, explorer shows the exit *sometimes* takes around 20 days.
> 
> I've tried exRemSpan to eliminate extra buy signals, but the sell
> order still always doesn't execute after 10 days.
> 
> 
> Buy = Random() > 0.975 ;         // Buy on a random day
> Sell = BarsSince( Buy ) >= 10;   // Sell after 10days..pretty please
> 
> //Buy  = ExRemSpan( Buy , 10) ;  // Dont raise buy signals for 10 days
> Buy  = ExRem( Buy , Sell ) ;    
> Sell = ExRem( Sell , Buy ) ;
> 
> //EXPLORER SETTINGS */
> Filter = Buy OR Sell;
> AddColumn( Buy, "Buy", 1 );
> AddColumn( Sell, "Sell", 1 );
> AddColumn( BarsSince( Buy ), "BarsSinceBuy", 1 ) ;  //show me barsince
> 
> 
> Many thanks
> Andy
> 
> 
> 
> 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
> 
> For other support material please check also:
> http://www.amibroker.com/support.html
>  
> Yahoo! Groups Links
> 
> 
> 
> 
> 

Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.15/579 - Release Date: 12/7/2006 1:31 PM