how to return indicator value to an array New comment eesfx 2007.06.03 04:12 Let's say I want to return the value of RSI into an array: extern double Lots = 1; double osfarray[10]; double rsivalue; double ind1; double ind2; double ind3; double ind4; double ind5; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- initializing of all array elements with 50 //- OSF Array 0 = Long 100 = short ArrayInitialize(osfarray,50); // indicators iRSI(NULL,0,14,PRICE_CLOSE,0) return(rsivalue); How can I do that? Secondly, is there a way to hold the rsivalue in a variable and then do some calculation on it, creating another variable such as RSI VALUE + Calculation which is independent variable? thanks. Arrays in build 198 not initialised [ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. MetaTrader 5 Platform update build 5120: Improvements and fixes okwh 2007.06.03 16:56 #1 frorexample: double osfarray[10]; for (int i=0; i<10;i++) osfarray[i] = iRSI(NULL,0,14,PRICE_CLOSE,i); New comment
extern double Lots = 1;
double osfarray[10];
double rsivalue;
double ind1;
double ind2;
double ind3;
double ind4;
double ind5;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//---- initializing of all array elements with 50
//- OSF Array 0 = Long 100 = short
ArrayInitialize(osfarray,50);
// indicators
iRSI(NULL,0,14,PRICE_CLOSE,0) return(rsivalue);
How can I do that?
Secondly, is there a way to hold the rsivalue in a variable and then do some calculation on it, creating another variable such as RSI VALUE + Calculation which is independent variable?
thanks.