Jump to content

(Req) Changing barcolour on macd crossing or above 0 line


Recommended Posts

I have found this indicator, Macd Candles V3 it paints the candlesticks as per the conditions of Macd, however I find only the the 2 colours in the inputs 4 Lime & 7 Red of any value set at thickness 5, the other input colours can be left at 0 or 1.

 

However these settings do not remain when changing timeframes and these settings cannot be saved as a template. Anyone can look at the code & alter it please.

 

The indicator is here:

 

http://www.mediafire.com/?m05nh9b1w51g79e

Link to comment
Share on other sites

You proboblt looking for this....I'm in the search for these for same time but can't find it anyvhere

 

It's used by rockwell...and work like this-when the macd line is above the signal line and above the zero line bars on chart ar colored in green,and reverse-if the macd is below the signal line and below the zero line bars are colred in red.If one of those two conditions is not achived bars are black(ex.macd is above signal line but below the zero).

 

They also uses RSI and works like this-when te line is above level 70 the little green triangle will be printed below the bar on the chart,and when the line is below level 30 red triangle will be printed above the bar.Period for rsi is 7,if that is important.

 

Reason why I axplain how it's works is because ,maybe somebody can code indicator for as,or maybe even EA for those who like EAs,I personaly prefer indicator.

 

 

http://img35.imageshack.us/img35/2035/capturekl.png

Edited by masterdeki
Link to comment
Share on other sites

masterdeki's version is for tradestation I think, the metatrader version does need tweaking, the main one being that the colour settings does not hold when changing TimeFrames.

 

Any genius programmers out there can look at the code please ?

 

What I do like about this version is the MTF display, when you have at least the first 3 colours matching, the move will be significant.

Edited by shabz
spelling
Link to comment
Share on other sites

I have found a cheat by changing the colours of the Macd candles to white (background) for the Maroon & Dark Green, so I only get the conditions showing for Lime & Red, which are the colours that I am reacting to anyway and that seems to work when changing timeframes.

If someone knows how to do it properly with metaeditor, please let me know.

Link to comment
Share on other sites

Can anybody look at the code and tell me how to stop indicator colour thickness settings from going back to default. Tried looking at the code but can't see where to change the colour thickness settings.

 

Help will be appreciated. Thanks.

Link to comment
Share on other sites

I don't think the file is protected, it's the way the code is written. The alteration needs to be made where "Set Index Style" line is, I have tried but failed here. It does compile but with errors.

 

 

#property indicator_chart_window

#property indicator_buffers 8

#property indicator_color1 Lime

#property indicator_color2 DarkGreen

#property indicator_color3 Maroon

#property indicator_color4 Red

#property indicator_color5 Lime

#property indicator_color6 White

#property indicator_color7 White

#property indicator_color8 Red

 

#property indicator_width1 0

#property indicator_width2 0

#property indicator_width3 0

#property indicator_width4 0

#property indicator_width5 10

#property indicator_width6 0

#property indicator_width7 0

#property indicator_width8 10

 

 

IndicatorBuffers(8);

SetIndexBuffer(0, g_ibuf_144);

SetIndexBuffer(1, g_ibuf_148);

SetIndexBuffer(2, g_ibuf_152);

SetIndexBuffer(3, g_ibuf_156);

SetIndexBuffer(4, g_ibuf_160);

SetIndexBuffer(5, g_ibuf_164);

SetIndexBuffer(6, g_ibuf_168);

SetIndexBuffer(7, g_ibuf_172);

SetIndexStyle(0, DRAW_HISTOGRAM,STYLE_SOLID, gd_128, MACD_UP_ABOVE_ZERO_color);

SetIndexStyle(1, DRAW_HISTOGRAM,STYLE_SOLID, gd_128, MACD_UP_BELOW_ZERO_color);

SetIndexStyle(2, DRAW_HISTOGRAM,STYLE_SOLID, gd_128, MACD_DN_ABOVE_ZERO_color);

SetIndexStyle(3, DRAW_HISTOGRAM,STYLE_SOLID, gd_128, MACD_DN_BELOW_ZERO_color);

SetIndexStyle(4, DRAW_HISTOGRAM,STYLE_SOLID, gd_136, MACD_UP_ABOVE_ZERO_color);

SetIndexStyle(5, DRAW_HISTOGRAM,STYLE_SOLID, gd_136, MACD_UP_BELOW_ZERO_color);

SetIndexStyle(6, DRAW_HISTOGRAM,STYLE_SOLID, gd_136, MACD_DN_ABOVE_ZERO_color);

SetIndexStyle(7, DRAW_HISTOGRAM,STYLE_SOLID, gd_136, MACD_DN_BELOW_ZERO_color);

return (0);

}

 

int deinit() {

ObjectDelete("macdm1");

ObjectDelete("macdm5");

ObjectDelete("macdm15");

ObjectDelete("macdm30");

ObjectDelete("macdh1");

ObjectDelete("macdh4");

ObjectDelete("macdd1");

ObjectDelete("macdw1");

ObjectDelete("macdmn1");

return (0);

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...