int timeFrameNumber = 3 ; //int timeFrame = {1,5,60}; //string timeFrame[] = {"M1", "M5", "H1"}; int timeFrame[] = { PERIOD_M1 , PERIOD_M5 , PERIOD_H1 }; string currencyPairs[] = { "AUDCAD" , "AUDNZD" , "AUDJPY" }
//if(CopyLow(currencyPairs[],timeFrame[],time[0],1,iLow)<=0) return(RESET); if ( CopyLow (currencyPairs[ 0 ], timeFrame[ 1 ], time[ 0 ], 1 , iLow ) <= 0 ) return (RESET);
1. In this case, currencyPairs [0] = "AUDCAD", timeFrame [1] = PERIOD_M5.
2. Since iLow, iHigh, iOpen, iClose, iTime are reserved words in MQL 4 language, they can not be used as variables.
3. I think that it is better to use iLow than to use CopyLow.
double price_low = iLow (currencyPairs[ 0 ], timeFrame[ 1 ], 0 );
1. In this case, currencyPairs [0] = "AUDCAD", timeFrame [1] = PERIOD_M5.
2. Since iLow, iHigh, iOpen, iClose, iTime are reserved words in MQL 4 language, they can not be used as variables.
3. I think that it is better to use iLow than to use CopyLow.
Thank you for your help. I incorporated the changes you suggested but couldn't get it to work across multiple timeframes and currency pairs. I'll post over in the 'Multi Timeframe Indicators' thread and see if they can help me there.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm trying to build an indicator that will alert me when a candle reaches a set size across multiple currency pairs and timeframes. I managed to get it working across two timeframes on one currency pair but have since modified it (see code below). I have searched the forum and managed to get some guidance but was hoping to get some further assistance/direction.
I've highlighted some code at the top of the indicator that covers the timeframes and currency pairs. Further along in the indictor I've highlighted some more code, "currencyPairs[],timeFrame[]", which replaced "Symbol(),Period()" (multiple times) in the one currency pair/two timeframe working version of this indicator.
In time I'm hoping to add further indictors (such as ADX) to this indictor.
Thank you for your help.