Background Chart Colour
kate682:
Hi
I have the attached indicator, but have been unable to get hold of the clever programmer.
The indicator will change your chart back ground colour based on the price to open of the
current candle. I have played around with it, but have been unable to make it default to
the daily candle no matter what time frame you are trading. If anyone can point me in
the right direction that would be great.
Regards
Kate
xx
Hi
You can do so:
#property indicator_chart_window int start() { color clr; if ( iClose( NULL, 1440, 0 ) > iOpen( NULL, 1440, 0 ) ) clr = LavenderBlush; else if ( iClose( NULL, 1440, 0 ) < iOpen( NULL, 1440, 0 ) ) clr = AliceBlue; else clr = White; ChartSetInteger( 0, CHART_COLOR_BACKGROUND, clr ); return (0); }
or as:
#property indicator_chart_window int deinit() { ObjectDelete( "lblChgBg" ); return(0); } int start() { color clr; if ( iClose( NULL, 1440, 0 ) > iOpen( NULL, 1440, 0 ) ) clr = LavenderBlush; else if ( iClose( NULL, 1440, 0 ) < iOpen( NULL, 1440, 0 ) ) clr = AliceBlue; else clr = White; if ( ObjectFind( "lblChgBg" ) == -1 ) ObjectCreate( "lblChgBg", OBJ_LABEL, 0, 0, 0 ); ObjectSet ( "lblChgBg", OBJPROP_XDISTANCE, 0 ); ObjectSet ( "lblChgBg", OBJPROP_YDISTANCE, 0 ); ObjectSet ( "lblChgBg", OBJPROP_CORNER, 0 ); ObjectSet ( "lblChgBg", OBJPROP_BACK, true ); ObjectSetText ( "lblChgBg", "ggg", 600, "Webdings", clr ); return (0); }
OK?
Hi
I have the attached indicator, but have been unable to get hold of the clever programmer.
The indicator will change your chart back ground colour based on the price to open of the
current candle. I have played around with it, but have been unable to make it default to
the daily candle no matter what time frame you are trading. If anyone can point me in
the right direction that would be great.
Regards
Kate
xx