Error in Formula

#1
Hi, I'm trying to acchive indicators in some code for an explorer, given by a certain level over ADX reading, my concern is that it stays on the upper 25 level but other readings are ignored.

Here is the Code:
Code:
// ADX Trend Indicator Signal
// PARAMETERS
	ADX_Parm	=	Param( "ADX Period", 10, 5, 50,1);
// FORMULA
	ADXwk		=	ADX(ADX_Parm) < 25;
	ADXst		=	ADX(ADX_Parm) > 25;
	ADXvs		=	ADX(ADX_Parm) > 50;
	ADXex		=	ADX(ADX_Parm) > 75;
	ADXchoppy         =	ADX(ADX_Parm) < PDI(ADX_Parm) AND ADX(ADX_Parm) < MDI(ADX_Parm);
// VARIABLES
	ADXc_Status	=	WriteIf(ADXwk,"Weak",
						WriteIf(ADXst,"Good",
						WriteIf(ADXvs,"Strong",
						WriteIf(ADXex,"EXCELENT",
						WriteIf(ADXchoppy,"Choppy","Neutral")))));
	ADXc_Color		=	IIf(ADXwk,colorRed,
						IIf(ADXst,colorDarkGreen,
						IIf(ADXvs,colorGreen,
						IIf(ADXex,colorLime,
						IIf(ADXchoppy,colorGold,colorLightGrey)))));
// EXPLORER
Filter = 1;
AddTextColumn(ADXc_Status,"ADX",1,colorWhite,ADXc_Color);
The problem is on the FORMULA section, I'm missing something to retrieve correctly the levels. Some Help..?

Cheers...
 

KelvinHand

Well-Known Member
#2
Hi, I'm trying to acchive indicators in some code for an explorer, given by a certain level over ADX reading, my concern is that it stays on the upper 25 level but other readings are ignored.

Here is the Code:
Code:
// ADX Trend Indicator Signal
// PARAMETERS
	ADX_Parm	=	Param( "ADX Period", 10, 5, 50,1);
// FORMULA
	ADXwk		=	ADX(ADX_Parm) < 25;
	ADXst		=	ADX(ADX_Parm) > 25;
	ADXvs		=	ADX(ADX_Parm) > 50;
	ADXex		=	ADX(ADX_Parm) > 75;
	ADXchoppy         =	ADX(ADX_Parm) < PDI(ADX_Parm) AND ADX(ADX_Parm) < MDI(ADX_Parm);
// VARIABLES
	ADXc_Status	=	WriteIf(ADXwk,"Weak",
						WriteIf(ADXst,"Good",
						WriteIf(ADXvs,"Strong",
						WriteIf(ADXex,"EXCELENT",
						WriteIf(ADXchoppy,"Choppy","Neutral")))));
	ADXc_Color		=	IIf(ADXwk,colorRed,
						IIf(ADXst,colorDarkGreen,
						IIf(ADXvs,colorGreen,
						IIf(ADXex,colorLime,
						IIf(ADXchoppy,colorGold,colorLightGrey)))));
// EXPLORER
Filter = 1;
AddTextColumn(ADXc_Status,"ADX",1,colorWhite,ADXc_Color);
The problem is on the FORMULA section, I'm missing something to retrieve correctly the levels. Some Help..?

Cheers...
ADXwk = ADX(ADX_Parm) < 25;
ADXst = ADX(ADX_Parm) >= 25 AND ADX(ADX_Parm) <50;
ADXvs = ADX(ADX_Parm) >=50 AND ADX(ADX_Parm) <75;
ADXex = ADX(ADX_Parm) >= 75;