MCPcopy Create free account
hub / github.com/TraderOracle/ATAS / OnRender

Method OnRender

LineOverload/LineOverload.cs:135–171  ·  view source on GitHub ↗
(RenderContext context, DrawingLayouts layout)

Source from the content-addressed store, hash-verified

133
134 #region RENDER
135 protected override void OnRender(RenderContext context, DrawingLayouts layout)
136 {
137 if (ChartInfo is null || InstrumentInfo is null)
138 return;
139
140 foreach (var l in lsS)
141 {
142 var xH = ChartInfo.PriceChartContainer.GetXByBar(CurrentBar, false);
143 var yH = ChartInfo.PriceChartContainer.GetYByPrice(l.price, false);
144 var yH2 = ChartInfo.PriceChartContainer.GetYByPrice(l.price2, false);
145 var yWidth = ChartInfo.ChartContainer.Region.Width;
146 RenderPen KPPen = new RenderPen(l.c, 2, DashStyle.Dash);
147 RenderPen MQPen = new RenderPen(l.c, 1, DashStyle.Solid);
148 RenderPen BSPen = new RenderPen(l.c, 3, DashStyle.DashDot);
149 RenderPen Pen = new RenderPen(l.c, 1, DashStyle.DashDotDot);
150 var rectPen = new Pen(new SolidBrush(l.c)) { Width = 2 };
151
152 if (l.price2 > 0)
153 {
154 DrawingRectangle dr = new DrawingRectangle(1, l.price, CurrentBar, l.price2, rectPen, new SolidBrush(l.c));
155 if (!Rectangles.Contains(dr))
156 Rectangles.Add(dr);
157 }
158 else {
159 if (l.source == "KP")
160 context.DrawLine(KPPen, 0, yH, xH, yH);
161 else if (l.source == "MQ")
162 context.DrawLine(MQPen, 0, yH, xH, yH);
163 else if (l.source == "BS")
164 context.DrawLine(BSPen, 0, yH, xH, yH);
165 else
166 context.DrawLine(Pen, 0, yH, xH, yH);
167 }
168 if (bShowText)
169 context.DrawString(l.label, new RenderFont("Arial", iFontSize), l.c, xH, yH);
170 }
171 }
172 #endregion
173
174 #region LOAD MANCINI

Callers

nothing calls this directly

Calls 1

DrawStringMethod · 0.45

Tested by

no test coverage detected