requesting 2 EMA crossover and painting the cross candle indicator

 

hi all here,

Well this is my first post here,and i think all here are pro coders in mq4....

my request is, as i have 2 ema cross over indi which plot arrow under or above the candle when 2 ema cross at this candle up or down...

could this candle "which made the cross" be colored instead of plotting an arrow ??? any one could help in that

another thing, the indi has a problem ... it plots the arrow when the 2 EMA intersect and equal in value i figuered that out when i was checking the 2 ema's value from the data box and i saw equal value for both. the shorter time ema has the same value as the longer one then the indi plots the arrow with this condition

could this problem be solved to let the indi plots arrows only when the shorter EMA has greater value or less value only ?

attached the indi


Files:
 

For colouring a candle, check Heikin Ashi indicator for ideas.
I have successfully managed this, but I do not recommend beginners trying to code it. However, it would be a GREAT learning experience; the concept of reversing values in two buffers to change colour is an interesting and IMO not well documented feature (maybe I looked in the wrong place).

On another negative note, I do not agree that equal EMAs will give an indicator flag.
Being a bit more helpful, the EMAs might SEEM equal but not be, and I suggest 2 changes:
- add

   IndicatorDigits(Digits);

or even

   IndicatorDigits(Digits + 1);

in your init() routine. This will display more decimal places than 4 (especially needed should you have 5 digit pricing).

- consider using NormalizeDouble to get rid of very small fractions of pricing in the EMA values

 

hi,

what i need is some one to modify this indy to paint the candle not to plot arrows at crosses of the 2 EMA's

any one could modify this indy attached in the first post plz??

thx

Reason: