Created
January 23, 2016 21:04
-
-
Save matthewkastor/5a141f1b8494f0d07048 to your computer and use it in GitHub Desktop.
function for knowing whether the adx indicator is above or below the given threshold level in metatrader 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// int adxIndicator = AdxIndicator(20, 14, 0); | |
int AdxIndicator(int adxThreshold, int period, int shift) { | |
double adx = iADX(Symbol(),PERIOD_CURRENT,period,PRICE_TYPICAL,MODE_MAIN,shift); | |
//double adxDiPlus = iADX(Symbol(),PERIOD_CURRENT,period,PRICE_TYPICAL,MODE_PLUSDI,shift); | |
//double adxDiMinus = iADX(Symbol(),PERIOD_CURRENT,period,PRICE_TYPICAL,MODE_MINUSDI,shift); | |
int output = 0; | |
if(adx > adxThreshold) { | |
output = 1; | |
} | |
return output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment