Margate, Fl.
Experience: Advanced
Platform: SierraCharts
Trading: Futures
Posts: 28 since Jun 2009
Thanks Given: 5
Thanks Received: 5
|
I'm trying to draw a rectangle at market session times, I'm hung up on getting a bar index at a specific date. Actually what I really want to do is define the different market start and end times, ny, london, etc. and grab the highest high to lowest low of each of those sessions, and draw a rectangle around that data. My code below is a feeble attempt at getting there, maybe someone can shed some light:
SCDateTime nyOpen, nyClose;
nyOpen.SetDateTimeYMDHMS(2012, 6, 20, 9, 00, 00);
nyClose.SetDateTimeYMDHMS(2012, 6, 20, 16, 00, 00);
---
Tool.ChartNumber = sc.ChartNumber;
Tool.DrawingType = DRAWING_RECTANGLEHIGHLIGHT;
Tool.Region = 0;
Tool.LineNumber = uniqueLineNumber;
Tool.BeginDateTime = nyOpen;
Tool.EndDateTime = nyClose;
Tool.BeginValue = sc.High[sc.BaseDateTimeIn[nyOpen]]; <-- possible??
Tool.EndValue = sc.Low[sc.BaseDateTimeIn[nyClose]]; <-- possible??
Tool.Color = COLOR_LIGHTBLUE;
Tool.SecondaryColor = COLOR_LIGHTBLUE;
Tool.AddMethod = UTAM_ADD_OR_ADJUST;
Tool.LineWidth = 2;
sc.UseTool(Tool);
|