PureBytes Links
Trading Reference Links
|
The correct
location of the vertical lines depends on what is selected in
Tools/Preferences/Intraday: If “END time of interval” is selected the
vertical lines location is correct; if “Start time of interval” is
selected the StartTime and EndTime
bars are shifted 1 bar to the right. The easiest way to correct this is by
subtracting at least 1 from the StartTime and EndTime (if so desired one can subtract up to 500 for a
5 min interval, up to 1500 for a 15 min interval and so on and achieve the same
result). This way the timestamp can be changed from “Start” to “End”
without affecting the vertical lines.
Some code to play and verify is shown below.
//Vertical time lines
Title = EncodeColor(4)+ _DEFAULT_NAME()+"; "+EncodeColor(1) + StrFormat("{{NAME}}
- {{INTERVAL}}; {{DATE}}; O=%g, H=%g, L=%g, C=%g (%.1f%%)
{{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) );
SubtractSel=ParamToggle("Subtract Secs","No|Yes",1);
SubtractVal=Param("Secs Subtracted",1,0,501,1); //to verify that subtraction has to
be>=1 and <=1 bar (500 for 5 min interval, 1500 for 15 min interval)
Shift=Param("End Time Shift in Min",5,0,45,5)*100;
Begin=ParamTime("Begin Time","21:05",0);
//BeginTime=EndTime=0;
if (SubtractSel)
{
BeginTime =Begin-SubtractVal;//works correctly with both "Begin time of
Interval" and "End time of Interval" (Preferences/Intraday)
EndTime = Begin+ Shift-SubtractVal;
}
if (!SubtractSel)
{
BeginTime =Begin;//works only correctly with "End time of interval";
Verticals are 5 min late when using "Begin time of interval"
EndTime = Begin+ Shift;
}
Plot(C,"C",1,64);
Plot( Cross( TimeNum(),BeginTime ), "\n"+WriteVal(TimeNum(),1.0),colorGreen
, styleHistogram |styleOwnScale | styleDashed, 0, 1 );
Plot( Cross( TimeNum(), EndTime ), "\n"+WriteVal(TimeNum(),1.0),colorRed ,
styleHistogram| styleOwnScale | styleDashed, 0, 1 );
From:
amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Reinsley
Sent: Saturday, March 06, 2010 1:30 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] trading hours vertical lines and day of the
week
Hi,
Few examples...
BR
to plot a vertical line based on hours
|
|
EndTime = 161500;
|
StartTime = 093000;
|
|
Plot( Cross( TimeNum(), EndTime ), "",
colorLightGrey, styleHistogram
|
| styleOwnScale | styleDashed, 0, 1 );
|
Plot( Cross( TimeNum(), StartTime ), "",
colorGrey40, styleHistogram |
|
styleOwnScale | styleDashed, 0, 1 );
|
EOD segment with intraday chart
segments = IIf ( Interval () < inDaily, Day (), Month () );
segments = segments != Ref ( segments , - 1 );
Plot ( segments, "" , colorDarkBlue, styleHistogram
| styleOwnScale | styleDashed | styleNoLabel );
Le 06/03/2010 16:50, gsmservplus a écrit :
hello,
sorry i`m not a AB programer or AFL guru, but how can i get together with
vertical lines between days in intraday,month in EOD we`ve got now,separate
vertical lines for trading hours.eg. i`d like to have one line in different
color at 9.30a.m. and one line at 16:00 in hourly,5-min. or 1-min charts.
and one more thing. any chance to have a day of the week(eg. Mon,Tue,Wed,Thu,Fri)
together with the dates we`ve got now on the standard AB charts?
thanks
__._,_.___
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
__,_._,___
|
|