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

Re: [amibroker] Re: BUY and SELL signal on same bar cashflow problem


  • Date: Tue, 09 Mar 2010 08:47:46 +0100
  • From: Tomasz Janeczko <groups@xxxxxxxxxxxxx>
  • Subject: Re: [amibroker] Re: BUY and SELL signal on same bar cashflow problem

PureBytes Links

Trading Reference Links



Hello,

Your formula is wrong. All delays in SetTradeDelays *must be the same*,
otherwise you could change the order of events (which is happening in your formula).

Also for N-bar stop use ApplyStop, not ExRemSpan.

Correct formula looks as follows:

Buy = 1;
Sell = Cover = Short = 0;

BuyPrice = Open;
SellPrice = Close;

TradeDays =
3;
ApplyStop( stopTypeNBar, stopModeBars, TradeDays );


Best regards,
Tomasz Janeczko
amibroker.com

On 2010-03-08 23:02, mbausys wrote:
> > //--- cut here ---
> > Buy = Sell = Short = Cover = False;
> > BuyPrice = SellPrice = ShortPrice = CoverPrice = 0;
> > SetOption("MaxOpenPositions", 1);
> > SetPositionSize(100, spsPercentOfEquity);
> > SetTradeDelays(1,0,1,0);
> > TradeDays = 3;
> > BuyPrice = ShortPrice = Open;
> > SellPrice = CoverPrice = Close;
> > Buy = ExRemSpan(True, TradeDays);
> > Sell = Ref(Buy, -TradeDays); 
> > //--- cut here ---
  


__._,_.___


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

__,_._,___