DrawRectagle alignment

Created at 23 Nov 2019, 20:45
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
HA

hackmushroom

Joined 22.09.2019

DrawRectagle alignment
23 Nov 2019, 20:45


Is there anyway to draw a rectangle so its aligned to the left or right of a chart bar, to cover the full width of either a single or group of bars? At the moment drawing a rectangle starts mid bar.

Couldn't see anything in the docs, is it even possible?


@hackmushroom
Replies

PanagiotisCharalampous
25 Nov 2019, 09:45

Hi hackmushroom,

DrawRectangle and generally all Draw methods take DateTime type as input for the X axis. So to achieve what you need, you need to plot the rectangle x dimensions on the exact time the bars starts/ends e.g. the h1 bar is drawn at approximately -25/+25 minutes.

Best Regards,

Panagiotis


@PanagiotisCharalampous