Questions from Beginners MQL5 MT5 MetaTrader 5 - page 144

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
Read carefully:
Return value
The function returns the index of the found element, taking into account the array's seriality. If it fails, the function returns -1.
Therefore, it should be like this:
1. Correct me if I've misunderstood.
Found all minima in the interval:
Since there is an array with minima, we use the ArrayMinimum function to find only the minimum from the array, without enumerating the gap in time(tss,tspp)
2. In the script, I put the code into a function:
all time parameters are shown correctly, but the variable min=0.0, although when bidding was going on it was showing the minimum of the specified interval. What could be the problem?
1. Correct me if I have misunderstood.
We have found all minima in the interval:
Since there is an array with minima, we use the ArrayMinimum function to find only the minimum from the array, without enumerating the gap in time(tss,tspp)
2. In the script, the code is placed in the function:
all time parameters are shown correctly, but the variable min=0.0, although when bidding was going on it was showing the minimum of the specified interval. What could be the problem?
In the scope of the variable. Make it global.
Moved variable "double min;" to global still =0.0
Script:
There is no OnInit and OnDeinit in the scripts.You have an error in your documentation https://www.mql5.com/ru/docs/constants/chartconstants/charts_samples
int ChartFirstVisibleBar(constlong chart_ID=0)
{
//--- prepare a variable for getting the value of the property
long result=-1;
//--- reset the error value
ResetLastError();
//--- get the value of the property
if(!ChartGetInteger(chart_ID,CHART_WINDOW_YD ISTANCE,0,result)) it should be CHART_FIRST_VISIBLE_BAR
{
//--- print the error message to the "Experts" journal
Print(__FUNCTION__+", Error Code = ",GetLastError());
}
//--- return the value of the chart property
return((int)result);
}
Script:
There is no OnInit and OnDeinit in the scripts.Thank you so much!!!
It worked for me!!!
Please tell me which programs to use to protect the EA and to limit the time of work, for example I need to protect the EA from decompilation, so it works only for 5 days.
I need a program where I can permanently limit the run time of the EA to give the EA to other people for testing.
When testing an EA, I have encountered the following difficulty.
The Expert Advisor does not trade (it has to) if:
When testing, I set Stop parameters from 1 to 33, Start from 1 to 33.
Of course, the tester produces about 2/3 of null results because Stop > Start in the tester sometimes occurs during overshooting.
These null tests take a lot of time.
Question: How can we disable testing of null tests in the Expert Advisor's code?
Logically, the test time should be reduced after the ban?
When testing an EA, I have encountered the following difficulty.
The Expert Advisor does not trade (it has to) if:
When testing, I set Stop parameters from 1 to 33, Start from 1 to 33.
Of course, the tester produces about 2/3 of null results because Stop > Start in the tester sometimes occurs during overshooting.
These null tests take a lot of time.
The question is how to disable testing null tests in EA code.
https://www.mql5.com/ru/docs/common/expertremove
This works in the tester. // At least it worked in the build before last one. It's been a while since I checked it.
https://www.mql5.com/ru/docs/common/expertremove
it works in the tester. // at least it worked in the build before last. it's been a while since i checked it.
I need a test pass. The EA does not trade if:
I want to do this to reduce the testing time.
Maybe there is a function in the Strategy Tester specifically for the input parameters that the Expert Advisor has?
If we getStop <=Start, we skip this pass.