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/
__,_._,___
|
|