Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 574

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
The task is to find the bar with the minimum closure
for(int x=0; x<=xBars -1; x++)
{
counter++;
// Print(Close[x],",",counter);
int h = ArrayMinimum(Close[x]);
if(counter > 20) break;
}
Compiler swears at Close
Write the closing prices in a separate array and then outside the ArrauMinimum chick
The task is to find the bar with the minimum close
there are iHighest and iLowest functions (now also in MT5)
there are iHighest and iLowest functions (now also in MT5)
The task is to find the bar with the minimum closure
for(int x=0; x<=xBars -1; x++)
{
counter++;
// Print(Close[x],",",counter);
int h = ArrayMinimum(Close[x]);
if(counter > 20) break;
}
The compiler swears at Close
The task of searching for the minimum/maximum price in MQL4 is solved by one line:
you can, but it won't be exactly a timer.
Thank you.
How do I calculate the lot volume in increments? If deposit =1000, lot = 0.1, deposit became 2000 lot = 0.2. That is, if the deposit is 1500 or 1700, the lot is not incremented.
Thank you.
How do I calculate the lot volume in increments? If deposit =1000, lot = 0.1, deposit became 2000 lot = 0.2. That is, if the deposit is 1500 or 1700, the lot does not increase.
Somehow...
Like this...
No, no, with a deposit of 1100, the lot will be 0.11, and I need the lot not to increase up to 2000. How do I set the step =1000 in the settings?
Hello programmers. Could you give me a hint on how to correctly approach the following condition:
1. The Expert Advisor opens 2 market orders (buy and sell) with the same lot specified in the settings. - The order is executed without any problems
The next one presents a problem, the price can move both to the SELL direction and to the BUY direction. How can we arrange the code so that when n points have been passed, the Expert Advisor would scan the profitability of those two deals in LIVE and close the order which has a negative balance after n points? If you have any other ideas how to do this, please advise.
I give you the code - draft, only the first point is executed, and 2 trades are opened with TP and SL
2. When the price reaches the specified amount of points, then I close order with a minus balance and open 2 more orders (buy and sell) with the same lot,
Stops are set at the opening price of the first order, i.e. if the trend reverses, all 3 orders should close simultaneously.