Say we have a few custom indicators in the bot/EA:
#resource "\\Indicators\\indi1.ex4"
#resource "\\Indicators\\indi2.ex4"
#resource "\\Indicators\\indi3.ex4" (has a resource to indi4.ex4) i.e. 2 level nested
#resource "\\Indicators\\indi4.ex4"
All these custom indicators work by themselves in the terminal but crash (cannot load) when they are combined as resources to be used inside the bot/EA, specifically indi3.ex4 / indi4.ex4.
iCustom(Symbol(),Period,"::Indicators\\indi4.ex4",param1,0,0);
iCustom(Symbol(),Period,"indi3.ex4::Indicators\\indi4.ex4",param1,0,0,0,0);
iCustom(Symbol(),Period,"\\Indicators\\indi3.ex4::Indicators\\indi4.ex4",param1,0,0,0,0);
iCustom(Symbol(),Period,"\\Experts\\autobot.ex4::Indicators\\indi4.ex4",param1,0,0,0,0);
I want to use all these indicators independent of each other in bot, but there is conflict between indi3 & indi4, is my guess.
What would be the correct calling code for iCustom()?
#resource "\\Indicators\\indi4.ex4" iCustom(Symbol(),Period,"::Indicators\\indi4.ex4",param1,0,0);
In both indi3 and your EA.
In both indi3 and your EA.
tried this syntax already and not work.
What is not working, please be more explicit. Show the relevant code, show your logs.
04:52:47 cannot load resource 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\GUID\MQL4\Libraries\::Indicators\indi4.ex4::Indicators\indi4.ex4'
04:52:47 Cannot load 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\GUID\MQL4\Libraries\::Indicators\indi4.ex4::Indicators\indi4.ex4'
04:52:47 cannot load resource 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\GUID\MQL4\Libraries\::Indicators\indi4.ex4::Indicators\indi4.ex4'
04:52:47 Cannot load 'C:\Users\Administrator\AppData\Roaming\MetaQuotes\Terminal\GUID\MQL4\Libraries\::Indicators\indi4.ex4::Indicators\indi4.ex4'
Please show the relevant code, as already asked. In which directory are your source(s) code ?
Obviously you are confused about your "path".
Please how the relevant code, as already asked. In which directory are your source(s) code ?
Obviously you are confused about your "path".
its not the location of the folder the .ex4 files are in the correct places, any other guesses?
Again the code as above is throwing cannot load resource as soon as the bot is attached to a chart. It compiles correctly.
Until recently, MT4 did not support nesting of resources. I wrote a task ( #1046703 ) into the service desk. The task is closed now as fixed (at 2014.07.29), so you should check if you have latest version.
which version of mt4 are you using?
My version is still outdated, and I made a workaround for this problem by extracting core part of my "middle" indicator into a library, which I included into my expert. So the nesting level of indicators became = 1, which works.
I asked in the service desk what is the version where the fix is committed, but I did not get response, alas.
I understand this post is very old, but I face the same problem.
//---- resource #resource "\\Indicators\\Heiken_Ashi_Smoothed.ex4" /** * Checks direction of Heiken Ashi Smoothed * @return int */ int GetHeikenAshiTrend(int shift) { double open = iCustom(Symbol(), 0, "::Indicators\\Heiken_Ashi_Smoothed.ex4", MaMetod, MaPeriod, MaMetod2, MaPeriod2, 4, shift); double close = iCustom(Symbol(), 0, "::Indicators\\Heiken_Ashi_Smoothed.ex4", MaMetod, MaPeriod, MaMetod2, MaPeriod2, 5, shift); if(close > open) return(OP_BUY); return(OP_SELL); }
Works in the tester, but when dragged to a chart...
Any idea why?
Thanks
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Say we have a few custom indicators in the bot/EA:
#resource "\\Indicators\\indi1.ex4"
#resource "\\Indicators\\indi2.ex4"
#resource "\\Indicators\\indi3.ex4" (has a resource to indi4.ex4) i.e. 2 level nested
#resource "\\Indicators\\indi4.ex4"
All these custom indicators work by themselves in the terminal but crash (cannot load) when they are combined as resources to be used inside the bot/EA, specifically indi3.ex4 / indi4.ex4.
iCustom(Symbol(),Period,"::Indicators\\indi4.ex4",param1,0,0);
iCustom(Symbol(),Period,"indi3.ex4::Indicators\\indi4.ex4",param1,0,0,0,0);
iCustom(Symbol(),Period,"\\Indicators\\indi3.ex4::Indicators\\indi4.ex4",param1,0,0,0,0);
iCustom(Symbol(),Period,"\\Experts\\autobot.ex4::Indicators\\indi4.ex4",param1,0,0,0,0);
I want to use all these indicators independent of each other in bot, but there is conflict between indi3 & indi4, is my guess.
What would be the correct calling code for iCustom()?