How to put a dot on top (or maybe change the colour) of a candle from a method in a helper class that does not extend Indicator?

Created at 05 Nov 2015, 09:00
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!
CT

ctid205024

Joined 04.11.2015

How to put a dot on top (or maybe change the colour) of a candle from a method in a helper class that does not extend Indicator?
05 Nov 2015, 09:00


I'm creating a cBot to try and automate my trading strategy and for that I'm creating a Candle class that will hold the methods that I will use on my trading strategy (i.e. previousCandle.IsBullishEngulfing()). 

I would like mark the candle with a small dot on the top from some methods, such as the IsBullishEngulfing. The code that I see only works with indicators, not with cBots. 

/algos/indicators/show/142

I don't think it's right to have my helper class Candle inheriting methods from the Indicator class, but if that's the only option then I'll do it. 

Just wondering if there's another way to draw on the chart. 

Thanks.


@ctid205024
Replies

Spotware
05 Nov 2015, 22:33

Dear Trader,

You could get the index of the latest candle using the following code snippet.

int index = MarketSeries.Close.Count-1;

Then you can iterate though the candles using the index and mark the candles you would like to mark.

Please have a look at the following indicator: /algos/indicators/show/253.


@Spotware