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

[amibroker] Re: Applystop using Close



PureBytes Links

Trading Reference Links

Tomasz

>From what I can see the function will still use H or L for the exit decision, not the CLOSE.

Consider the following example for a long only EOD system:

In the Settings > Trades tab of AA, I have:
- buy price = open ; delay = 0
- sell price = open ; delay = 0

My AFL is:

SetTradeDelays(1,1,0,0);
Buy = Cross(EMA(C,8), EMA(C,15));
Sell = 0;
ApplyStop(stopTypeProfit, stopModePercent, 10, False, False);
Equity(1);


IE, I want to sell at tomorrow's open only when the price *closes* above 110% of the entry price (open of day after buy trigger).

I run scan > backtest > Show current trade for one of the AA listings. The buy arrow occurs at a bar where open == 10.0865. Therefore, I want to sell when the price *closes* above 10.0865 * 1.1 (== 11.0952).

I now examine the bar before the sell arrow on the chart. It shows H == 11.2269 and C == 11.0774. So the exit has occurred next day because the HIGH has exceeded buyprice * 110%.

I know this is correct behavior as detailed in the manual, but what I am asking is whether the function can be tweaked or enhanced so that the sell decision depends on the relation of the CLOSE to the buyprice.

Thanks



--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> wrote:
> Hello,
> 
> Just set "ExitAtStop" parameter to FALSE and it will trade as per your settings in "Trade" tab.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message -----
> From: "thelunit" <thelunit@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Tuesday, August 19, 2003 2:28 AM
> Subject: [amibroker] Applystop using Close
> 
> 
> > I would like to use Applystop function due to its simplicity. However, I want to trigger stops by reference to the CLOSE of the
> current day. Eg, if price *closes* above given threshold, then sell next day. If price *closes* below stoploss or trail, then sell
> next day.
> >
> > Can anyone tell me if it's possible to tweak Applystop function to achieve this result? Or must I write some kind of loop to do
> it.
> >
> > Thanks
> >
> >
> >
> >
> > Send BUG REPORTS to bugs@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > --------------------------------------------
> > Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
> >


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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