Hi,

Basically I scan 500 stocks everyday to find stocks that have buy signal(such 
as price have crossed MA 50). Then I buy the stocks and exit them in 5 days 
after I boought them.

MA=EMA(C,50);
Buy = Cross( MA, C );
Sell = BarsSince(Buy)>5;

But the backtester don't sell stocks exactly 5 days after I bought them.
 
Say yesterday I bought stock A,  today I bought stock B. 
The backtester will sell both A and B 5 days after today, which is not what I 
really want!

What I want is to sell stock A 5 days after the time I bought A which is 
yesterday not today. 

Basically I want to have sell time for each stock to be 5 days after their 
individaul purchase dates.
But "Sell = BarsSince(Buy)>5;" can't do that.

Please help!

Thanks a lot

Tao









Reply via email to