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

Re: [amibroker] Re: Equity(1) help.



PureBytes Links

Trading Reference Links

Glen,

Your code specifies use tomorrow's price to buy today.

You might be better of using:

BuyPrice = Open;
Buy         = Ref(BuyCondition,-1);

This says use yestersay's price data to buy today at open.

You may not see much difference but you'll have errors in duration of
holding period and miss out on a trade if there is a signal the last day or
have a buy price og 0 (zero) since tomorrow price is not available.



This way you use yesterday closing price calculation to buy today at open.
----- Original Message ----- 
From: "Glenn" <glennokb@xxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, July 22, 2003 11:04 PM
Subject: [amibroker] Re: Equity(1) help.


> OK,
>
> It looks like I've solved it!
>
> Simply added this to the scan...
>
> BuyPrice=ref(O,1);
>
> Cheers, Glenn
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Glenn" <glennokb@xxxx> wrote:
> > Hi,
> >
> > I have read the latest post in the ALF language help
> > http://www.amibroker.com/guide/afl/afl_view.php?name=EQUITY
> that
> > Equity(1) can't be used with SetTradeDelays other then in backtesting.
> >
> > I would like to use Equity(1) in my "Scan" as I use Applystop for a
> profit
> > and initial stop therefore I really need to use Equity(1).
> >
> > The problem I have is I would like to use the open of the following day
> > (the day I actually buy the stock) after the alert to calculate the
> > applystop exits. ie: not the day that the alert was triggered as Equity
> (1)
> > does.
> >
> > In a scan if I use ref(buy,-1) then the exit will be calculated as I
would
> > like but the buy is also delayed...no good!
> >
> > I have tried a few things in my scan formula but I can't get the buy
> alert
> > AND the sell alert correct (using the day after the buy alert for
> > calculating it) in the Scan results.
> >
> > Is there any way to do this? Thanks.
> >
> > Cheers, Glenn
>
>
>
> 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/
>
>



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges & Refill Kits for Your Epson at Myinks.com
Free shipping on orders $50 or more to the US and Canada.
http://www.c1tracking.com/l.asp?cid=5705&lp=home/epson.asp
http://us.click.yahoo.com/brYXfA/_xWGAA/ySSFAA/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/