Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
Hi Gordon, as you can see on the code you've just posted, if you like to change the color permanent, just change ALL WHITE and RED word to whatever color you like, then compile the custom indicator. Please let me know should this could solve your problem. Hope this help
__________________ David Michael H
"Trader helps traders with sincerity, honesty and integrity"
for(cnt=1;cnt<=OrdersTotal();cnt++) {
if( OrderValueSymbol(cnt) == Symbol() )
{
Order = 1;
break;
}
else
{
Order = 0;
}
}
if( OrdersTotal() == 0 ) Order = 0;
if( OrdersTotal() < 5 && Order == 0 )
etc....
Bongo. The first position in the trade pool is 0 instead of 1. The for loop should look like this : for(int i=0;i<Orderstotal();i++){
Also, are you using custom functions?
Cheers!
__________________
"Anyone who has never made a mistake has never tried anything new." -Albert Einstein
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 blue
#property indicator_color3 Red
#property indicator_color4 blue
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//|------------------------------------------------------------------|
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM, 0, 1, Red);
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexStyle(1,DRAW_HISTOGRAM, 0, 1, blue);
SetIndexBuffer(1, ExtMapBuffer2);
SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, Red);
SetIndexBuffer(2, ExtMapBuffer3);
SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, blue);
SetIndexBuffer(3, ExtMapBuffer4);
//----
SetIndexDrawBegin(0,10);
SetIndexDrawBegin(1,10);
SetIndexDrawBegin(2,10);
SetIndexDrawBegin(3,10);
//---- indicator buffers mapping
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexBuffer(3,ExtMapBuffer4);
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
double haOpen, haHigh, haLow, haClose;
if(Bars<=10) return(0);
ExtCountedBars=IndicatorCounted();
//---- check for possible errors
if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
if (ExtCountedBars>0) ExtCountedBars--;
int pos=Bars-ExtCountedBars-1;
while(pos>=0)
{
haOpen=(ExtMapBuffer3[pos+1]+ExtMapBuffer4[pos+1])/2;
haClose=(Open[pos]+High[pos]+Low[pos]+Close[pos])/4;
haHigh=MathMax(High[pos], MathMax(haOpen, haClose));
haLow=MathMin(Low[pos], MathMin(haOpen, haClose));
if (haOpen<haClose)
{
ExtMapBuffer1[pos]=haLow;
ExtMapBuffer2[pos]=haHigh;
}
else
{
ExtMapBuffer1[pos]=haHigh;
ExtMapBuffer2[pos]=haLow;
}
ExtMapBuffer3[pos]=haOpen;
ExtMapBuffer4[pos]=haClose;
pos--;
}
//----
return(0);
Gordon
Hi Gordon, I got the problem. If you like BLUE for your color, you must write "Blue" instead of "blue" , MetaEditor is CASE SENSITIVE. I've tested it and it should be work. Hope this help and let me know should you still have other problem
__________________ David Michael H
"Trader helps traders with sincerity, honesty and integrity"
hi gang,
i thought this will be the right place to ask this. how can i refresh the charts from code? or how can i refresh indicators from their code? i ask this because some indicators plot ...and then when i click on refresh..change their values a bit. thanks for the help.
I have a doubt, i want to color my bars acording to this criteria:
I have this Inverse fisher transform of RSI indicator witch i want to use to color the bars blue when its increasing, and red when its decreasing...
Ill try to attach the indicator i case of someone could help me..