Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1592
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
Hi everyone, please upload for download if you have any katala-type indicators for mt 5. i really need????
CodeBase to help: https://www.mql5.com/ru/search#!keyword=%D0%BA%D0%D0%B0D0%BD%D0%D0%BB%D1%8B&module=mql5_module_codebase.
I need the Expert Advisor to print in the log the size of the loss on all losing orders. I have written a loop in the body of the Start function but it turns out that the same data is printed in the journal several hundreds of times. I understand that the Start function body processes the loop anew with every tick and therefore we get infinite duplication of data. Please advise me how should it be done scientifically? Here is my code:
***
The final goal: if an order is closed by a stop-loss on a long trend, it will automatically open an order in the other direction. I know how to implement it, but the problem is that orders to the other side are opened hundreds of times. Thank you for your reply.
I need the Expert Advisor to print in the log the size of the loss on all losing orders. I have written a loop in the body of the Start function, but it turns out that the same data is printed in the journal several hundreds of times.
The final target is: if an order is closed by a stop loss on a long trend, it will automatically open an order in the other direction. I know how to implement it, but the problem is that orders to the other side are opened hundreds of times. Thank you for your feedback.
Size of loss on all losing orders
Print("Closed with a minus:", trade,"/", OrderProfit());
End goal: in case of closing an order at a stop loss
you need to look for the last losing order and you go through all losing orders
Loss on all losing orders
Print("Closed with a minus:", trade,"/", OrderProfit());
End goal: in case of closing an order at a stop loss
you need to look for the last losing order and you go through all losing orders.
Makar, look more carefully...
the Start function body processes the loop anew with every tick and therefore we get infinite duplication of data. Please advise me how should it be done scientifically? Here is my code:
***
The final goal: if an order is closed by a stop-loss on a long trend, it will automatically open an order in the other direction. I know how to implement it, but the problem is that orders to the other side are opened hundreds of times. Thank you for your reply.
If you want to print only once, you better do it as a script. Worked out - fell off...
Makar, pay attention...
If you only need to print once, it's better to do it as a script. Worked out - fell off...
The amount of loss on all losing orders
I must have got it wrong again
or the amount of loss for each losing order
or the summary loss on all losing orders...
If you need only a single print, you'd better do it as a script
You don't have to, you can do it like this
Good day!
Does MT5 allow me to comfortably group open positions for each instrument and each direction (BUY/SELL) to see the total position amount, total profit, average price and current unrealized profit
Of course, I would like it to be implemented as in a tree - under the "plus". You may close it if you want, and open it if you want.
If you want to understand the code, go through all the logic of the EA, what it does and under what conditions.
I have made the entire EA very clear to you, even for beginners, if you do not understand it, ask.
If you want to get an EA written, you, as a "law-abiding citizen", should go here
please tell me if I understand correctly,
function://| Count open orders
int CountOrders() - is it necessary only for "start/stop" button?
Please tell me if I understand correctly,
function://| Count open orders
int CountOrders() - is it needed only for operation of button "start/stop"?
Not only, check the opening condition of the first order, see where CountOrders() is spelled out.