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

[amibroker] Re: AB using intraday data to display daily bars



PureBytes Links

Trading Reference Links

The code below is my attempt to create a simple indicator that will 
show the previous days HI and LOW (horizonal line) plus the previous 
day to that one also as I am viewing either a daily or realtime 
intrday chart using AB.  However, there seems to be a few problems 
that I could not correct.

Problems:

1. In order for the lines to appear for the desired indicator lines, 
my cursor has to be on the current chart for which I am viewing. It 
would be nice if it automatically just assumed that you wanted the 
current day. 

2. The code works for all days on a give stock (daily view) except 
for the current day.  I cant figure out why it does not draw the 
lines. The lines would be very short however it should post the 
results at the right in number, but does not do that.  When in 
intraday mode it shows the line however, for the most current day's 
previous days hi's and low's  

Your help for improving this indicator is appreciated.
MR


Plot(C, "Close", 1, styleCandle);

day_high1 = TimeFrameExpand(Ref(TimeFrameCompress
(H,inDaily,compressHigh),-1),inDaily,expandFirst);
day_low1 = TimeFrameExpand(Ref(TimeFrameCompress
(L,inDaily,compressHigh),-1),inDaily,expandFirst);  
day_high2 =TimeFrameExpand(Ref(TimeFrameCompress
(H,inDaily,compressHigh),-2),inDaily,expandFirst); 
day_low2 = TimeFrameExpand(Ref(TimeFrameCompress
(L,inDaily,compressHigh),-2),inDaily,expandFirst); 

Line1 = IIf(SelectedValue(DateTime())< DateTime(),SelectedValue
(day_high1),Null);
Line2= IIf(SelectedValue(DateTime())< DateTime(),SelectedValue
(day_low1),Null); 
Line3 = IIf(SelectedValue(DateTime())< DateTime(),SelectedValue
(day_high2),Null);
Line4 = IIf(SelectedValue(DateTime())< DateTime(), SelectedValue
(day_low2),Null);

Plot(Line1,"line1",colorRed,styleThick); 
Plot(Line2,"line2",colorBrightGreen,styleThick);
Plot(Line3,"line3",colorYellow,styleThick);  
Plot(Line4,"line4",colorBlue,styleThick);


Title = Name() + " - (" + Interval(2) + " chart)  "  + Date() + "   
(" +  WriteVal(ROC(C,1),1.2)+"%)" + " " + "Volume" + WriteVal(V);



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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