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

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


  • Date: Tue, 09 Mar 2010 13:13:50 +0100
  • From: Tomasz Janeczko <groups@xxxxxxxxxxxxx>
  • Subject: Re: [amibroker] Re: Help Please !!!How to control sell time with Barsince for more than 1 stocks

PureBytes Links

Trading Reference Links



Hello,

My point is that it is obsolete and while it is valid it has drawbacks:
a) works only in regular backtest mode, does not work in raw, raw2, raw2multi, and rotational modes
b) because exremspan processes entire array the formula would not take into account "Range" setting
(i.e. buys will occur every 5th bar since the beginning of quotations,
not since "range" start, if range is not "all quotes", then first buy may not occur on first in-range bar).
In order to account for range setting you would need to add Status("barinrange")
c) its operation depends on trade delays being equal

ApplyStop method does _not_ have any of the above problems.

Best regards,
Tomasz Janeczko
amibroker.com

On 2010-03-09 11:43, Anthony Faragasso wrote:
Is this not valid then ?
 
Buy = 1;
Buy = ExRemSpan( Buy, 5 );
Sell = Ref( Buy, -5 );
 
 
----- Original Message -----
Sent: Tuesday, March 09, 2010 2:49 AM
Subject: Re: [amibroker] Re: Help Please !!!How to control sell time with Barsince for more than 1 stocks

 

Hello,

YOU MUST USE APPLYSTOP instead of ExRemSpan !!!

Sell = 0; //
ApplyStop( stopTypeNBar, stopModeBars, 5 ); // 5- day stop !!!

That is the ONLY way of implementing N-bar stop that works
in ALL backtest modes !

Best regards,
Tomasz Janeczko
amibroker.com


On 2010-03-08 23:54, Mike wrote:

That should read:

Sell = Ref(ExRemSpan(Buy, 5), -5);

http://www.amibroker.com/guide/afl/afl_view.php?id=50

Mike

--- In amibroker@xxxxxxxxxps.com, "Anthony Faragasso" <ajf1111@xxx> wrote:
  
Did you try:

Sell=exremspan(buy,5);


  ----- Original Message ----- 
  From: Tao 
  To: amibroker@xxxxxxxxxps.com 
  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/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@yahoogroups.com 
    amibroker-fullfeatured@xxxxxxxxxxxxcom

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxcom

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/


  


__._,_.___


**** 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

__,_._,___