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

[amibroker] Re: determining daily H/L/C from intraday data



PureBytes Links

Trading Reference Links

Sheldon,

I've been working on this and have the solution that will give you 
the values for the day before:

// Walt Schwarz (aka Hiry Mug) 8/4/2003
//
sel=DateNum()!=Ref(DateNum(),-1);
tgtS=LastValue(ValueWhen(sel,BarIndex(),2));
tgtE=LastValue(ValueWhen(sel,BarIndex(),1));
DayHigh = ValueWhen( BarIndex()== tgtE, 
HHV( High,tgtE-ValueWhen (BarIndex()== tgtS ,tgtS)) );
DayLow = ValueWhen( BarIndex()== tgtE, 
LLV(Low,tgtE-ValueWhen (BarIndex()== tgtS ,tgtS)) );
DayClose=ValueWhen(BarIndex()== tgtE,C);

Plot(DayHigh,"Hi",colorRed);
Plot(DayLow,"Lo",colorBlue);
Plot(DayClose,"C",colorGold);
//

I am still trying to get the numbers for previous days so I can back- 
test...
                 Walt

>> Intra-day sure has it's idiosyncrasies (I am working with 1 minute 
data)

 
--- In amibroker@xxxxxxxxxxxxxxx, "sheldonskidmore" <sheldon@xxxx> 
wrote:
> All,
> 
> I am writing an intraday system (works on hourly data) that takes 
> yesterday's H/L/C as inputs.  However, I am having a problem 
getting 
> those daily values from my intraday code.  Here is what I have so 
> far, but I'm not getting the values I expect (for any of the 
values):
> 
> w_high  = HighestSince(DateNum()>Ref(DateNum(),-1),H,1);
> w_low   = LowestSince(DateNum()>Ref(DateNum(),-1),L,1);  
> w_close = ValueWhen(DateNum()>Ref(DateNum(),-1),C,1);
> 
> Any ideas of what I might be doing wrong?
> 
> Thanks,
> Sheldon


------------------------ 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/sO0ANB/LIdGAA/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/