The problem is, I want that line's location to update whenever the second instrument's price changes but as the code is currently written the screen does not update till the first instrument's price changes.
What is the most efficient way to force the chart to update and show the new location of the line whenever the second instrument's price changes. In other words how can I use the event of the second instrument's price change to repaint the chart? Here is the relevant parts of my code:
protected override void Initialize()
{
CalculateOnBarClose = false;
Add(Instrument.FullName, PeriodType.Minute, 1); //This will be Bars index 1
FFirstMarketIndex = 1;
Add(SecondMarketSymbol, PeriodType.Minute, 1); //This will be Bars index 2
FSecondMarketIndex = 2;
}
protected override void OnBarUpdate()
{
if(BarsInProgress == FSecondMarketIndex)
{
DrawRay();
}
Comment