I have a strategy which the user inputs prices and it will draw the line on the chart. I want to be able to move the lines on the chart and have it update the price values which are used for order entry.
I am not sure the correct method but this is what i am trying to use:
protected override void OnDrawObjectsCallback(string tag, object sender, EventArgs args)
{
if (State != State.Realtime || sender == null)
return;
if (sender is HorizontalLine line)
{
double price = line.StartAnchor.Price;
switch (tag)
{
case "LongLevel1":
UpdateLongLevel(1, price);
break;
case "LongLevel2":
UpdateLongLevel(2, price);
break;
// Add cases for other Long Levels as needed
case "ShortLevel1":
UpdateShortLevel(1, price);
break;
case "ShortLevel2":
UpdateShortLevel(2, price);
break;
// Add cases for other Short Levels as needed
case "Pivot1":
UpdatePivotLevel(1, price);
break;
case "Pivot2":
UpdatePivotLevel(2, price);
break;
// Add cases for other Pivot Levels as needed
}
}
}
This gives me an error that there is no suitable method for override. Could you give me any suggestions or if this is not the correct way?