(RenderContext context, DrawingLayouts layout)
| 73 | } |
| 74 | |
| 75 | protected override void OnRender(RenderContext context, DrawingLayouts layout) |
| 76 | { |
| 77 | var font = new RenderFont("Calibri", iFontSize); |
| 78 | var fontB = new RenderFont("Calibri", iFontSize, FontStyle.Bold); |
| 79 | int upY = 50; |
| 80 | int upX = 50; |
| 81 | var txt = "Howdy"; |
| 82 | var tsize = context.MeasureString(txt, fontB); |
| 83 | |
| 84 | txt = $"MetroPlex version " + sVersion; |
| 85 | context.DrawString(txt, fontB, Color.Gold, upX, upY); |
| 86 | upY += tsize.Height + 6; |
| 87 | TimeSpan t = TimeSpan.FromMilliseconds(clock.ElapsedMilliseconds); |
| 88 | String an = String.Format("{0:D2}:{1:D2}:{2:D2}", t.Hours, t.Minutes, t.Seconds); |
| 89 | txt = $"ACTIVE on {TradingManager.Portfolio.AccountID} since " + dtStart.ToString() + " (" + an + ")"; |
| 90 | context.DrawString(txt, fontB, Color.Lime, upX, upY); |
| 91 | if (!clock.IsRunning) |
| 92 | clock.Start(); |
| 93 | |
| 94 | tsize = context.MeasureString(txt, fontB); |
| 95 | upY += tsize.Height + 6; |
| 96 | |
| 97 | if (TradingManager.Portfolio != null && TradingManager.Position != null) |
| 98 | { |
| 99 | txt = $"{TradingManager.MyTrades.Count()} trades, with PNL: {TradingManager.Position.RealizedPnL}"; |
| 100 | context.DrawString(txt, font, Color.White, upX, upY); |
| 101 | upY += tsize.Height + 6; |
| 102 | txt = sLastTrade; |
| 103 | context.DrawString(txt, font, Color.White, upX, upY); |
| 104 | } |
| 105 | |
| 106 | } |
| 107 | |
| 108 | protected override void OnCalculate(int bar, decimal value) |
| 109 | { |
nothing calls this directly
no test coverage detected