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

Re: [amibroker] Identifying yesterday's closing price in intraday strategy



PureBytes Links

Trading Reference Links

Hello,

I have been using a plugin by Daniel...which is very efficient....

/*
Requires deDateTime AmiBroker Plugin DLL.
You can get the DLL at http://www.amibroker.net/3rdparty/deDateTime.zip
*/

MarketOpen = 93000;    // May need to change this to reflect the first
possible time available in your data (ie 93100)
MarketClose = 160000;  // May need to change this to reflect the last
possible time available in your data (ie 155900)

DaysBack = 1;    // Note: By adjusting Daysback to a greater value, all
the calculations below will go back a number of corresponding days (ie:
Daysback = 5 means 5 days ago, Daysback = 1 is yesterday)
YHigh =
ValueWhen(deFlagLastBarOfDay(MarketClose),HHV(H,BarsSince(deFlagFirstBarOfDay(MarketOpen))),DaysBack);

YLow =
ValueWhen(deFlagLastBarOfDay(MarketClose),LLV(L,BarsSince(deFlagFirstBarOfDay(MarketOpen))),DaysBack);

YClose = ValueWhen(deFlagLastBarOfDay(MarketClose),C,DaysBack);
yOpen = ValueWhen(deFlagLastBarOfDay(MArketopen),O,Daysback);

Hope this helps.
Anthony

"vzhig " wrote:

>  Dear all,
>
> I'm having trouble with identifying yesterday's closing price in my
> intraday strategy. I'm doing it like this:
>
> Cl = ValueWhen(TimeNum()==155900.00, C, 1);
>
> but the problem is that for some stocks/days 15:59 bar is not present
> and then the last day with 15:59 bar gets referenced.
>
> Daychange = Day() != Ref(Day(), -1);
> Cl = ValueWhen(Daychange, Ref(C,-1), 1);
>
> doesn't fit either because it is influenced by afterhours trading.
>
> Any ideas?
>
>
>                    Yahoo! Groups Sponsor
                        ADVERTISEMENT


>
> 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 the Yahoo! Terms of Service.


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/