fxninjai:
not all control paths return a value MTF2_MACD_BDv09_01_20.mq4 13 659
1 error(s), 1 warning(s) 2 2
'MTF2_MACD_BDv09_01_20.mq4' MTF2_MACD_BDv09_01_20.mq4 1 1
'return' - expressions are not allowed on a global scope MTF2_MACD_BDv09_01_20.mq4 14 4not all control paths return a value MTF2_MACD_BDv09_01_20.mq4 13 659
1 error(s), 1 warning(s) 2 2
Change this . . .
int init() { //---- indicator line SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_NONE); SetIndexDrawBegin(1,SignalSMA); IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1); SetIndexBuffer(0,Signal); SetIndexBuffer(1,EMAofMACD); SetIndexBuffer(2,Main); //---- name for DataWindow and indicator subwindow label string TimeFrameStr; if (Period() == 1) TimeFrameStr = "MACD_Period_M5"; if (Period() == 5) TimeFrameStr = "MACD_Period_M15"; if (Period() == 15) TimeFrameStr = "MACD_Period_H1"; if (Period() == 30) TimeFrameStr = "MACD_Period_H4"; if (Period() == 60) TimeFrameStr = "MACD_Period_H4"; if (Period() == 240) TimeFrameStr = "MACD_Period_D1"; if (Period() == 1440) TimeFrameStr = "MACD_Period_W1"; if (Period() == 10080) TimeFrameStr = "MACD_Period_MN1"; if (Period() == 43200) TimeFrameStr = "MACD_Period_MN1"; IndicatorShortName("MTF2_MACD_BDv09_01_20 ("+FastEMA+","+SlowEMA+","+SignalSMA+","+EMAofMACDPer+") ("+TimeFrameStr+")"); } //---- return(0);
to this . .
int init() { //---- indicator line SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_NONE); SetIndexDrawBegin(1,SignalSMA); IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1); SetIndexBuffer(0,Signal); SetIndexBuffer(1,EMAofMACD); SetIndexBuffer(2,Main); //---- name for DataWindow and indicator subwindow label string TimeFrameStr; if (Period() == 1) TimeFrameStr = "MACD_Period_M5"; if (Period() == 5) TimeFrameStr = "MACD_Period_M15"; if (Period() == 15) TimeFrameStr = "MACD_Period_H1"; if (Period() == 30) TimeFrameStr = "MACD_Period_H4"; if (Period() == 60) TimeFrameStr = "MACD_Period_H4"; if (Period() == 240) TimeFrameStr = "MACD_Period_D1"; if (Period() == 1440) TimeFrameStr = "MACD_Period_W1"; if (Period() == 10080) TimeFrameStr = "MACD_Period_MN1"; if (Period() == 43200) TimeFrameStr = "MACD_Period_MN1"; IndicatorShortName("MTF2_MACD_BDv09_01_20 ("+FastEMA+","+SlowEMA+","+SignalSMA+","+EMAofMACDPer+") ("+TimeFrameStr+")"); return(0); // this line moved inside the braces . . . } //----
fxninjai:
and this one also plz
')' - unexpected token RSI_BDv09_01_26.mq4 312 65
'-' - unexpected token RSI_BDv09_01_26.mq4 314 44
'else' - illegal 'else' without matching 'if' RSI_BDv09_01_26.mq4 316 7
not all control paths return a value RSI_BDv09_01_26.mq4 325 1
16 error(s), 2 warning(s) 17 3
Replace this . . .
string StringUpperCase(string str) { string s = str; int lenght = StringLen(str) - 1; int char; while(lenght >= 0) { char = StringGetChar(s, lenght); if((char > 96 && char < 123) || (char > 223 && char < 256)) { s = StringSetChar(s, lenght, char - 32); } else if(char > -33 && char < 0) { s = StringSetChar(s, lenght, char + 224); } lenght--; } return(s); }
with this . . .
string StringUpperCase(string str) { string s = str; int lenght = StringLen(str) - 1; int character; while(lenght >= 0) { character = StringGetChar(s, lenght); if((character > 96 && character < 123) || (character > 223 && character < 256)) { s = StringSetChar(s, lenght, character - 32); } else if(character > -33 && character < 0) { s = StringSetChar(s, lenght, character + 224); } lenght--; } return(s); }
<3 :p working like a charm now all ok :)
Bravo work you guys keep it up good work let me see if i can have any issue with other indicator so feeling so relaxed I was really tensed phewww :p
i have same problem when i replace
this
string StringUpperCase(string str) { string s = str; int lenght = StringLen(str) - 1; int char; while(lenght >= 0) { char = StringGetChar(s, lenght); if((char > 96 && char < 123) || (char > 223 && char < 256)) { s = StringSetChar(s, lenght, char - 32); } else if(char > -33 && char < 0) { s = StringSetChar(s, lenght, char + 224); } lenght--; } with this string StringUpperCase(string str) { string s = str; int lenght = StringLen(str) - 1; int character; while(lenght >= 0) { character = StringGetChar(s, lenght); if((character > 96 && character < 123) || (character > 223 && character < 256)) { s = StringSetChar(s, lenght, character - 32); } else if(character > -33 && character < 0) { s = StringSetChar(s, lenght, character + 224); } lenght--; } return(s); } i have one error == string uppercase not found int stringToTimeFrame(string tfs) { tfs = stringUpperCase(tfs); for (int i=ArraySize(iTfTable)-1; i>=0; i--) if (tfs==sTfTable[i] || tfs==""+iTfTable[i]) return(MathMax(iTfTable[i],Period())); return(Period()); } return(s); } can someone help me please
rocktheedge:
i have same problem when i replace
this
If you have the "same" problem apply the "same" fix . . . you have a different problem so start a new thread.
string StringUpperCase(string str) { : i have one error == string uppercase not found int stringToTimeFrame(string tfs) { tfs = stringUpperCase(tfs);
Apples are not Oranges- Why not use the supplied function StringToUpper - MQL4 Documentation See also Alphabetic Index of MQL4 Functions (600+) - MQL4 forum
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
'MTF2_MACD_BDv09_01_20.mq4' MTF2_MACD_BDv09_01_20.mq4 1 1
'return' - expressions are not allowed on a global scope MTF2_MACD_BDv09_01_20.mq4 14 4not all control paths return a value MTF2_MACD_BDv09_01_20.mq4 13 659
1 error(s), 1 warning(s) 2 2
somebody fix it plz :(
and this one also plz
')' - unexpected token RSI_BDv09_01_26.mq4 312 65
'-' - unexpected token RSI_BDv09_01_26.mq4 314 44
'else' - illegal 'else' without matching 'if' RSI_BDv09_01_26.mq4 316 7
not all control paths return a value RSI_BDv09_01_26.mq4 325 1
16 error(s), 2 warning(s) 17 3
both of them was working fine :( after update got these errors plz fix it I donno how to program mql4