Please, use
button to insert MQL-code.

I wished to tell to you, that correctly formatted code will read through to much
more people, and probability of that you receive advice, will be more. To take
offence in the financial market senselessly.
int start() { int counted_bars=IndicatorCounted(); //---- //---- check for possible errors if (counted_bars<0) return(-1); //---- last counted bar will be recounted if (counted_bars>0) counted_bars--; int pos=Bars-counted_bars; //---- main calculation loop //pos = 200; while(pos>=0) { double dHigh; double dLow7, dLow9, dLow13, dLow25 ,dClose16 ; double dResult, dClose20, dCalc, dFallBack ; //dWhatEver = 1; dFallBack = 4.00003 + ((Close[16] * 10000) - 13000) ; dLow7 = ((Low[7]*10000)-13000); dLow9 = ((Low[9] * 10000) - 13000); dLow13 = ((Low[13] * 10000) - 13000); dLow25 = ((Low[25] *10000) - 13000); dClose20 = ((Close[20] * 10000) - 13000); dCalc = dFallBack; if(dLow7 > dCalc) {if(dLow25 > dCalc) {if(dLow9 > dCalc) {if(dLow13 > dCalc) {if(dClose20 > dCalc) { dCalc = dCalc + 5.00022; }else {} }else {} }else {} }else {} }else {} dResult = ((dCalc + 13000) / 10000); //dResult = dResult + 1.310; //Comment("Number1 = ", DoubleToStr(dClose,4)); //Comment("Number2 = ", DoubleToStr(dLow,4)); Comment("Number3 = ", DoubleToStr(dResult,4)); ExtMapBuffer1[pos]= dResult ; pos--; } //---- return(0); }
This code in other words:
int start() { int counted_bars=IndicatorCounted(); //---- //---- check for possible errors if (counted_bars<0) return(-1); //---- last counted bar will be recounted if (counted_bars>0) counted_bars--; int pos=Bars-counted_bars; //---- main calculation loop //pos = 200; while(pos>=0) { double dHigh; double dLow7, dLow9, dLow13, dLow25 ,dClose16 ; double dResult, dClose20, dCalc, dFallBack,Support=1.30 ; //dWhatEver = 1; dFallBack = Close[16] -Support+4*Point ; dLow7 = Low[7]-Support; dLow9 = Low[9]-Support; dLow13 = Low[13]-Support; dLow25 = Low[25]-Support; dClose20 = Close[20]-Support; dCalc = dFallBack; if(dLow7 > dCalc && dLow25 >dCalc && dLow9 > dCalc && dLow13 > dCalc && dClose20 > dCalc) dResult = dCalc + 5*Point + Support; else dCalc + Support; Comment("Number3 = ", DoubleToStr(dResult,4)); ExtMapBuffer1[pos]= dResult ; pos--; } //---- return(0); }
I don't understand logics of this indicator and cannot to help to you.
DxdCn:
use print to outpu dResult to log windows, check it values.
I guess ExtMapBuffer1[] 's valuse not proper, for example if values betweent 1. 310000000 1 to 1.3100001.
note: in one window, all values draw base on same axes, so should in a proper ranges!
use print to outpu dResult to log windows, check it values.
I guess ExtMapBuffer1[] 's valuse not proper, for example if values betweent 1. 310000000 1 to 1.3100001.
note: in one window, all values draw base on same axes, so should in a proper ranges!
Thank you for your reply
will check my code on your advise
Regards
peter_zyn

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If I change the price registers CODE (O,H,L,C)for example e.g.
From Low[7] to Low[pos+7] it draws a graph, However it shifts the indicator forward approx 16 bars
Regards
Peterg
int start()
{
int counted_bars=IndicatorCounted();
//----
//---- check for possible errors
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
if (counted_bars>0) counted_bars--;
int pos=Bars-counted_bars;
//---- main calculation loop
//pos = 200;
while(pos>=0)
{
double dHigh;
double dLow7, dLow9, dLow13, dLow25 ,dClose16 ;
double dResult, dClose20, dCalc, dFallBack ;
//dWhatEver = 1;
dFallBack = 4.00003 + ((Close[16] * 10000) - 13000) ;
dLow7 = ((Low[7]*10000)-13000);
dLow9 = ((Low[9] * 10000) - 13000);
dLow13 = ((Low[13] * 10000) - 13000);
dLow25 = ((Low[25] *10000) - 13000);
dClose20 = ((Close[20] * 10000) - 13000);
dCalc = dFallBack;
if(dLow7 > dCalc)
{if(dLow25 > dCalc)
{if(dLow9 > dCalc)
{if(dLow13 > dCalc)
{if(dClose20 > dCalc)
{ dCalc = dCalc + 5.00022;
}else {}
}else {}
}else {}
}else {}
}else {}
dResult = ((dCalc + 13000) / 10000);
//dResult = dResult + 1.310;
//Comment("Number1 = ", DoubleToStr(dClose,4));
//Comment("Number2 = ", DoubleToStr(dLow,4));
Comment("Number3 = ", DoubleToStr(dResult,4));
ExtMapBuffer1[pos]= dResult ;
pos--;
}
//----
return(0);
}