Multiple Moving Averages

#1
Hi there...

I have a litttle problem:

I want to make an exploration code, but Im having problems to deal with Arrays vs Variables for this criteria:

1) I Want to select from a Parameter List, different kind of Moving Averages,
2) Then with the selection, make a calculation based on a formula:


This is what I have now, but gives me errors:

Code:
///////////////////////////////////
// Moving Averages Explorer  //
///////////////////////////////////
_SECTION_BEGIN("MA Short, Mid and Long Terms and Trend");
// PARAMETERS
	MAParam	=	ParamList("Moving Average", "MA|EMA|Wilders");
	Period	=	Param("Period",9,5,14,1);
	Period2	=	Param("Perdid2",100,5,200,1);
	//	VARIABLES
MA_m	=	0;
//	FORMULA FOR EXPLORATION
//		Short term signals
	MABuy		=	Cross(MAParam(C,Period), MA_m(C,Period2));
	MASell		=	Cross(MA_m(C,Period2),MA_m(C,Period));
	MABuy		=	ExRem(MABuy, MASell);
	MASell		=	ExRem(MASell, MABuy);
	MABull		=	MA_m(C,Period) > MA_m(C,Period2);
	MABear		=	MA_m(C,Period) < MA_m(C,Period2);
// VARIABLES
	MA_Status	=	WriteIf(MABuy, "-=BUY=-",
				WriteIf(MASell, "-=SELL=-",
				WriteIf(MABull, "Bullish",
				WriteIf(MABear, "Bearish","Neutral"))));
	MA_Color	=	IIf(MABuy, colorLime,
				IIf(MABull, colorGreen,
				IIf(MABear, colorOrange,
				IIf(MASell, colorRed,colorBlue))));
_SECTION_END();

//////////////////////
// Exploration Code //
//////////////////////
_SECTION_BEGIN("Explorer");
// FILTER
Filter = 1;
// DISPLAY COLUMNS
	AddTextColumn	(MA_Status,"EMA Short",1, MA_Color,BColor_mas);
_SECTION_END();
Please, if your could help me to solve this basic programming error.

XeL
 

Similar threads