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

[amibroker] Odd BarsSince behavior



PureBytes Links

Trading Reference Links

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


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.9/573 - Release Date: 12/5/2006 4:07 PM