The code compiles fine,
What do you mean by it doesn't work ? Does it show some errors ? Does it do anything strange ?
Hello,
I created an expert depending on custom indicator. it is work perfectly at windows 7 but dose not work at window 10
Can anyone tells me the reason and how to fix this problem?
Have you tried it on another Win 10 PC ?
-
“Doesn't work” is meaningless — just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires — meaningless.
How To Ask Questions The Smart Way. (2004)
When asking about code
Be precise and informative about your problemUse the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010) -
Windows 7 extended support period begins in January 2020 when Windows 7 support ended officially, and it ends in January 2023 for good.
New MetaTrader 4 Platform build 1220 - MQL4 programming forum - Page 3 #26 (2020) Your code switch(index) { case 0: if(CopyBuffer(handle,0,shift,1,buf)>0) return(buf[0]); break; case 1: if(CopyBuffer(handle,1,shift,1,buf)>0) return(buf[0]); break; case 2: if(CopyBuffer(handle,2,shift,1,buf)>0) return(buf[0]); break; case 3: if(CopyBuffer(handle,3,shift,1,buf)>0) return(buf[0]); break; case 4: if(CopyBuffer(handle,4,shift,1,buf)>0) return(buf[0]); break; default: break; }
Simplified if(CopyBuffer(handle,index,shift,1,buf)>0) return(buf[0]);
-
int handle=iAC(symbol,timeframe); ⋮ int handle=(int)iAD(symbol,timeframe,VOLUME_TICK); ⋮ int handle=iAlligator(symbol,timeframe,jaw_period,jaw_shift, teeth_period,teeth_shift, lips_period,lips_shift, ma_method,applied_price); ⋮ int handle=iADX(symbol,timeframe,period); ⋮ int handle=iAO(symbol,timeframe); ⋮ int handle=iATR(symbol,timeframe,period); ⋮ int handle=iBearsPower(symbol,timeframe,period); ⋮ int handle=iBullsPower(symbol,timeframe,period); ⋮ int handle=iBands(symbol,timeframe,period, bands_shift,deviation,ma_method); ⋮ int handle=iCCI(symbol,timeframe,period,price); ⋮ int handle=iDeMarker(symbol,timeframe,period); ⋮ int handle=iEnvelopes(symbol,timeframe, ma_period,ma_shift,ma_method, applied_price,deviation); if(handle<0) return(-1); return(CopyBufferMQL4(handle,mode-1,shift)); }
Perhaps you should read the manual, especially the examples.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick/OnCalculate (after the indicator has updated its buffers), you use the handle, shift and count to get the data.
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 (2020)
How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 (2020)
MQL5 for Newbies: Guide to Using Technical Indicators in Expert Advisors - MQL5 Articles (2010)
How to call indicators in MQL5 - MQL5 Articles (2010)
After i press "OK" it is disappearing
Custom indicator name. If the name starts with the reverse slash '\', the EX5 indicator file is searched for relative to the MQL5\Indicators indicator root directory. Thus, when calling iCustom(Symbol(), Period(), "\FirstIndicator"...), the indicator is downloaded as MQL5\Indicators\FirstIndicator.ex5. If the path contains no file, the error 4802 (ERR_INDICATOR_CANNOT_CREATE) occurs.
const string IndicatorName="(My_Heckin_ashi)";
is that your indicator names?
what is written in your platform expert and journal tab? Nothing?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I created an expert depending on custom indicator. it is work perfectly at windows 7 but dose not work at window 10
Can anyone tells me the reason and how to fix this problem?