Questions from Beginners MQL5 MT5 MetaTrader 5 - page 335

 

I understand that the indicator does not need to get a path through this function to itself, due to the fact that I explicitly specify it.

I.e., the above code will be enough to use an indicator in an Expert Advisor and place it in a marketplace?

My custom indicator does not create one or more copies of itself.

 
R0MAN:

I.e. will the above code be enough to use the indicator in the EA and place the EA in the marketplace?

This can be tested. Temporarily move the used indicator to another directory somewhere. Or install another copy of the terminal, where there will be no custom indicators and transfer only the *.ex5 file there for testing.
 
tol64:
This can be tested. Temporarily move used indicator to another directory somewhere. Or install another copy of the terminal without custom indicators and transfer only *.ex5 file there for testing.
Thank you. Was getting acquainted with your marketplace products today as an example... There are options...
 
R0MAN:

Have I correctly completed the code of an Expert Advisor that uses a custom indicator to place it in the Market according to the article?


Do I need to apply this function or not?

"The path to itself can be obtained using the GetRelativeProgramPath() function, an example of its use is given below:"

It seems to be correct. The indicator in this case is embedded in the Expert Advisor.

I have a question on the same subject.

I am adding three indicators :

#resource "\\Indicators\\Bollinger new.ex5"
#resource "\\Indicators\\BandWidth.ex5"
#resource "\\Indicators\\Oscillator For BBS.ex5"
..............
   BolBandsNewHandle=iCustom (NULL,TF_graph,"::Indicators\\Bollinger new", 
                                  InpBandsPeriodUpper,
                                  InpBandsPeriodLower,
                                  InpBandsShiftUpper,
                                  InpBandsShiftLower,
                                  InpBandsDeviations,
                                  InpBandsDeviations1, PRICE_CLOSE);
                                  
   BandWidthHandle=iCustom (NULL,TIMEFRAMES_Band_Width,"::Indicators\\BandWidth",
                                  TIMEFRAMES_Band_Width,
                                  InpBandsPeriodUpper1,
                                  InpBandsPeriodLower1,
                                
                                  InpBandsDeviations10,
                                  InpBandsDeviations11);                                  
                                  
                                                                  
  Oscillator_For_BBS_Handle=iCustom (NULL,TF_Oscillator,"::Indicators\\Oscillator For BBS",
                                   TF_Oscillator,
                                   InpOscillator,                       
                                   InpOscPeriod1,                        
                                   InpOscPeriod2,
                                   InpOscPeriod3,
                                   InpAppliedPrice,
                                   InpVOLUME,
                                   InpDrawMode,
                                   InpLevelsPeriod,
                                   InpLevelsPeriod1,
                                   InpLevelsIndent,
                                   InpLevelsIndent1
                                   );

ButBandWidth indicatortakes data fromBollinger new indicator, code inside:

   BBHandle=iCustom  (NULL,TIMEFRAMES_Band_Width,"//Experts\\BBS.ex5::Indicators\\Bollinger new.ex5",
                                  InpBandsPeriodUpper1,
                                  InpBandsPeriodLower1,
                                  InpBandsShiftUpper1,
                                  InpBandsShiftLower1,
                                  InpBandsDeviations10,
                                  InpBandsDeviations11, PRICE_CLOSE);

In my terminal everything works, but the copy of compiledBBS.ex5 file in another terminal does not find theBollinger newindicator.

2014.12.21 20:05:59.941 BBS.ex5::Indicators\BandWidth (EURUSD,M30) cannot load custom indicator 'Bollinger new' [4802]

Maybe the path is wrong ("Experts\\BBS.ex5::Indicators\\Bollinger new.ex5"). How to set the correct path forBandWidth indicatorto findBollinger new indicatorinside the resource? Is it possible? Maybe, who has faced such a problem, please advise.

P/S All works, question removed. Thank you all!

 
Crucian:

...

ButBandWidth indicatortakes data fromBollinger new indicator, code inside:

...

Maybe the path is wrong (Experts\\BBS.ex5::Indicators\\Bollinger new.ex5"). How to set path correctly so thatBandWidth indicatorfindsBollinger new indicatorinside the resource? Is it possible? Who may have faced such a problem, please advise.

...

How to specify a correct path in this case?
 
barabashkakvn:
Так как всё-таки в таком случае прописать правильно путь?
barabashkakvn
:

So how do I set the path correctly in this case?

The path is correct, at least the Expert Advisor is tested and does not give errors.

I have copied the BandWidth indicator and it started referring only to technical indicators. Then I got angry and rewroteBandWidth indicator which referred only to technical indicators and recalculatedthem.It was done correctly)))).

It is harmful to have several terminals of different brokers on the cope, after deleting them the folders in App Date are left.

 
Crucian:

The path is correct, at least the Expert Advisor is tested and does not give errors.

I have copied the BandWidth indicator and it started referring only to technical indicators. Then I got angry and rewroteBandWidth indicator which referred only to technical indicators and recalculatedthem.It was done correctly)))).

It is harmful to have several terminals of different brokers on the cope and after deleting them the folders in App Date are left.

Got it. Thank you.

I'll be posting after the New Year, it looks like. :-)

 

Good day to all.
Please advise on testing EAs.

I am just beginning to learn how to write EAs.

I downloaded this EA: https://www.mql5.com/ru/code/1812, opened it in the editor, ran it for debugging, started testing and nothing happens. No trades open and therefore no results.

I have also tried other EAs, including the easiest one taken from here, which should just open and close trades. Same thing - nothing happens.

I have tried putting a breakpoint. It works only in OnInit. The rest of the code does not work, which is very strange.

I have understood that OnTick works by adding an Alert. However, no trades are opened and they are not opened even if the required conditions are met.

I have added an Alert(GetLastError(). The error 4753 is displayed.

The question is if I am doing something wrong. Are any of the conditions required for testing not satisfied?

Thank you in advance for your response.

EA based on indicator SAR, ADX and SMA 100
EA based on indicator SAR, ADX and SMA 100
  • votes: 27
  • 2014.06.13
  • Mauro Bracuti
  • www.mql5.com
Советник на базе индикаторов SMA, ADX и SAR.
 
Maxi-M:

Good day to all.
Please advise on testing EAs.

I am just beginning to learn how to write EAs.

I downloaded this EA: https://www.mql5.com/ru/code/1812, opened it in the editor, ran it for debugging, started testing and nothing happens. Deals do not open and therefore no results.

I have also tried other EAs, including the easiest one taken from here, which should just open and close trades. Same thing - nothing happens.

I have tried putting a breakpoint. It works only in OnInit. The rest of the code does not work, which is very strange.

I have understood that OnTick works by adding an Alert. However, no trades are opened and they are not opened even if the required conditions are met.

I have added an Alert(GetLastError(). The error 4753 is displayed.

The question is this: Maybe I am doing something wrong? Are any of the conditions required for testing not satisfied?

Thank you in advance for your response.

Good afternoon. Please attach a screenshot of the log.

 
Tapochun:

Good afternoon. Please attach a screenshot of the logbook.

Please. The screenshot contains the logbook as well as the settings.
Files:
screeen.jpg  321 kb
Reason: