Your image shows “cannot load indicator/BullBearPower.ex5”
Either you didn't put the indicator in the indicators folder, and/or you didn't successfully compile it.
Your image shows “cannot load indicator/BullBearPower.ex5”
Either you didn't put the indicator in the indicators folder, and/or you didn't successfully compile it.
So the problem is in the indicator not the EA ? I have the indicator in the indicators folder as shown in the attached photo. Should i move it to the examples or free indicators folder?
you can also copy the indicator's code in the code editor and compile it , it will give you zero errors. And i know the indicator's code works well because it paints the oscillator when added to the chart as in the photo
The problem is clear. Your indicator name is "BBP test" but you called it with another name.
input string IndicatorName = "BullBearPower"; // Indicator NameThe real filename should be put into iCustom call, not the Indicator Shortname.
Just recompile the indicator and make sure it is in the correct folder...why do you have an input parameter for the path of the indicator instead of just hardcoding it in your EA????
The problem is clear. Your indicator name is "BBP test" but you called it with another name.
The real filename should be put into iCustom call, not the Indicator Shortname.Just recompile the indicator and make sure it is in the correct folder...why do you have an input parameter for the path of the indicator instead of just hardcoding it in your EA????
Thanks it worked. Do you know if i can embed the custom indicator's code right into the EA's code so that i can use it directly without the call function?
- 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 have made a custom indicator written in MQL5 which does the following:
1- Calculate the 9-period hull moving average for the open prices. Name it HMA9open
2- Calculate the 9-period hull moving average for the high prices. Name it HMA9high
3- Calculate the 9-period hull moving average for the low prices. Name it HMA9low
4- Calculate Bullpower using the following equation: Bullpower = HMA9high - HMA9open
5- Calculate Bearpower using the following equation: Bearpower = HMA9low - HMA9open
6- Calculate Bullbearpower using the following equation: Bullbearpower = Bullpower + Bearpower. Name it BBP
7- Plot BBP as a histogram which has a green color if its value is greater than or equal zero and a red color if its value is lower than zero
The indicator works fine and is painted as a green/red histogram oscillator around zero when compiled
This is the custom indicator’s code:
Now I need to write an expert advisor code in MQL5 which:
1- Opens only one buy position whenever the custom indicator’s value equals more than zero, and closes any open sell positions
2- Opens only one sell position whenever the custom indicator’s value equals less than zero, and closes any open buy positions
This is my attempt at writing the EA’s code :
The EA gives 0 errors when compiled. However when i try to backtest the EA it gives these errors (in the attached screenshot)
How can i solve this issue?