protected override void OnBarUpdate() { //Add your custom strategy logic here. if (CurrentBar == 30) { Draw.ExtendedLine(this, "RedLine", true, 20, High[20], 10, High[10], Brushes.Red, DashStyleHelper.Solid, 2); Draw.ExtendedLine(this, "BlueLine", true, 20, Low[20], 10, Low[10], Brushes.Blue, DashStyleHelper.Solid, 2); } if (CurrentBar == 35) RemoveDrawObject("BlueLine"); }
Note, I've tested this code within an Indicator and in that context the blue line is removed just fine. I image this strategy code would also work fine in Realtime, but I'm interested in getting it to work in Historical backtesting.
Any ideas?
Thanks in advance.
Comment