ADX filter problem

 

Hi guys.


I want ask You if You can help me with some explaining. I have indicator that I have bought from my friend but I want some upgrades and he don't have time for do these :(

Therefore I am trying to do this upgrade alone but I don't understand some thinks.

Please can You explain me what exactly are these lines?:

THX

double ADXBuffer[4];
ADXBuffer[0] = iADX(Symbol(),0,ADXperiod, PRICE_CLOSE,MODE_MAIN,0);
ADXBuffer[1] = iADX(Symbol(),0,ADXperiod, PRICE_CLOSE,MODE_MAIN,1);
ADXBuffer[2] = iADX(Symbol(),0,ADXperiod, PRICE_CLOSE,MODE_MAIN,2);
ADXBuffer[3] = iADX(Symbol(),0,ADXperiod, PRICE_CLOSE,MODE_MAIN,3);

if( (ADXBuffer[3] > ADXBuffer[2]) && (ADXBuffer[2] < ADXBuffer[1]) && ADXBuffer[2] != 0 )
{
string timeStmp = TimeToStr(Time[1]);
double pctD = 100*(ADXBuffer[1]/ADXBuffer[2]-1);
string pct = DoubleToStr(pctD,1)+"%";
string headerStr = Symbol()+" "+TimeFrameDescShort(Period())+" "+timeStmp+" "+DoubleToStr(ADXBuffer[2],2)
+"->"+DoubleToStr(ADXBuffer[1],2)+" ("+pct+")";

string bodyStr = headerStr+"\n===========================================\n\n"
+reportPrice+"\n"+reportOsMA+"\n"+reportADX+"\n"+reportStoch+"\n"+report21EMA+"\n"+report50SMA+"\n"+report200SMA+"\n";
if( stochOk[0] && stochOk[1] && stochOk[2] && stochOk[3] )
report( pctD, ADXUpwardPercentageThreshold, headerStr, "MT4: "+headerStr, bodyStr, SoundUserFile);

 
In order to understand those, you'll have to learn to code.
 
ubzen:
In order to understand those, you'll have to learn to code.

it is not possible to explain my what this line is doing:

if( (ADXBuffer[3] > ADXBuffer[2]) && (ADXBuffer[2] < ADXBuffer[1]) && ADXBuffer[2] != 0 )

I understan it little but I don't get the last ADXBuffer[2] != 0 what this mean.


Thanks for help

 

ADXBuffer[2] != 0

It means, If Adx is Not-Equal to 0.

Adx is a name of a built in indicator. Buffer in the name usually means it's intended to be used as an External buffer within a Indicator. [] means its an Array. The 2 indicate the array location where the value is stored. The value is more than likely from 3 bars ago...counting the current bar as 0. {2...1...0}

 
ubzen:

ADXBuffer[2] != 0

It means, If Adx is Not-Equal to 0.

Adx is a name of a built in indicator. Buffer in the name usually means it's intended to be used as an External buffer within a Indicator. [] means its an Array. The 2 indicate the array location where the value is stored. The value is more than likely from 3 bars ago...counting the current bar as 0. {2...1...0}


Thank You very much for great explain. I know what ADX. But all other informations were great.

Please can You tell me what is "double" it is very often use in this custom indicator but in more format.

for example like here

double ADXBuffer[4];

DoubleToStr(pctD,1)+"%";

 
dancostare:
Please can You tell me what is "double" it is very often use in this custom indicator but in more format.

what is double: RTFM