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

Re: [amibroker] "AllowSameBarExit" not working



PureBytes Links

Trading Reference Links

try this
LongStop = ref(Low,-1) - 0.0010;

-- 
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://www.aflwriting.com


On 02/02/07, dralexchambers <dralexchambers@xxxxxxxxx> wrote:
> I have some backtester code below. Despite setting the
> "AllowSameBarExit" option to True, the position is not being sold on
> the same day.
>
> See this JPG for my explanation:
>
> http://www.chambers-media.com/01.jpg
>
> The black arrow is the setup day
> The green arrow is the buy day
> The blue line is a trailing stop loss. When the low of the day passes
> through the low, a sell is triggered.
>
> The position should enter and exit on the same day (B).
>
> However, the backtester enters on (B) but exits on (C)!
>
> Can anyone suggest - alex
>
> ==============================
>
> SetOption("FuturesMode" , False);
> SetBarsRequired(10000,10000);
>
> SetTradeDelays(0,0,0,0);
> SetOption("AllowSameBarExit",True);
>
> SetOption("MarginRequirement",0);
> SetOption("MinShares",1);
>
> Buy = Longsetup AND H>StopBuy;
> BuyPrice = Max(Open,StopBuy);
>
> LongStop = (Low-1) - 0.0010;   // Trail SL 10 pips behind
>
> Sell =  L < LongStop;
> Buy = ExRem( Buy, Sell );
> Sell = ExRem( Sell, Buy );
> SellPrice = Min(Open,LongStop);
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> Yahoo! Groups Links
>
>
>
>

Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.20/664 - Release Date: 2/2/2007 3:42 PM