chartObjects
chartObjects
14 Dec 2012, 07:23
Can I use the Chart object in a robot to mark the chart everytime I execute an order? any ideas how to do this?
Replies
lec0456
14 Dec 2012, 15:52
( Updated at: 23 Jan 2024, 13:11 )
RE:
Please look at the examples in the API Reference for the methods in [ChartObjects]. If you like to DrawText everytime the order is executed you should use this in the OnPositionOpened method.
For example:
protected override void OnPositionOpened(Position openedPosition) { ChartObjects.DrawText("myObject", "text", StaticPosition.TopLeft); }
So, yes, I have this line in my OnPositionOpened. it does not crash but it does not place a B or S on the chart where trades were executed???
ChartObjects.DrawText("Trade" + TradeBarID.ToString(), position.TradeType==TradeType.Buy?"B"+position.Id:"S", MarketSeries.Close.Count-1, position.EntryPrice+3*Symbol.PipSize, VerticalAlignment.Center, HorizontalAlignment.Center, Colors.Yellow);
@lec0456
admin
14 Dec 2012, 09:45 ( Updated at: 15 Jan 2024, 14:51 )
Please look at the examples in the API Reference for the methods in [ChartObjects]. If you like to DrawText everytime the order is executed you should use this in the OnPositionOpened method.
For example:
@admin