DrawText on the EMA cross

Created at 16 Sep 2015, 22:48
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!
MaVe's avatar

MaVe

Joined 24.08.2015

DrawText on the EMA cross
16 Sep 2015, 22:48


Is it possible to draw a symbol on the crossing of the two EMA's,

with the DrawText function?


@MaVe
Replies

Spotware
17 Sep 2015, 06:20

Dear Trader,

Please have a look at the HasCrossedAbove method and at the following indicator Draw Objects.


@Spotware

MaVe
17 Sep 2015, 09:29 ( Updated at: 21 Dec 2023, 09:20 )

RE:

Dear Spotware,

I understand the functions mentioned above,

Specific: a dot on the EMA crossing lines, as seen on the chart below.

Is that possible?


@MaVe

MaVe
17 Sep 2015, 12:06

Dear Spotware,

If I use the HasCrossedAbove Function and the ChartObjects.DrawVerticalLine Internal,
together with VerticalAlignment and TextOffset, then it is not possible to have the dot/bullet/arrow
directly om the crossing-lines of the two EMA's each time.
(Compared to the VerticalLine)

Is that correct?

Is there something to combine this with the values of the two EMA's.
That is to say when the value of EMA1=EMA2.
(The position of the white circles that I've put manually on the chart above)


@MaVe

Spotware
18 Sep 2015, 06:43

Dear Trader,

You could write a loop checking the values of the Indicators if you like to use this approach. 

You are able to compare the results of indicators by just using an "if" statement. The following code snippet illustrates it:

if (ema1.Result[index_X] == ema2.Result[index_Y])
//Do something

Additionally we would like to inform you that we do not provide coding assistance services. We more than glad to assist you with specific questions about cAlgo.API. You also can contact one of our Partners or post a job in Development Jobs section for further coding assistance.


@Spotware