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

Re: [amibroker] Help Please !!!How to control sell time with Barsince for more than 1 stocks?


  • Date: Mon, 8 Mar 2010 12:18:53 -0500
  • From: "Anthony Faragasso" <ajf1111@xxxxxxxx>
  • Subject: Re: [amibroker] Help Please !!!How to control sell time with Barsince for more than 1 stocks?

PureBytes Links

Trading Reference Links



Did you try:
Sell=exremspan(buy,5);
 
 
----- Original Message -----
From: Tao
Sent: Thursday, March 04, 2010 5:17 PM
Subject: [amibroker] Help Please !!!How to control sell time with Barsince for more than 1 stocks?

 

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



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___