Questions from Beginners MQL4 MT4 MetaTrader 4 - page 128

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
Sell order closes at Ask price
I'm a little confused! Point the finger where the bug is in the code!!!(log says ORDER CLOSE ERROR 4108) Thanks in advance!
Good afternoon Connoisseurs! Have you exhausted the hardest day of the year? Can we get down to business? ;=).
I drew an EA, everything is good, but MQL as I understand it works in MT4 environment. I want it to work with software that works directly with the exchange. Are there any other MQL compilers? If not, what language should I use to rewrite MQL?
You have a break and you need to continue.
I do not have a break. What is the reason why the EA may not "see" its orders? I have different server and computer times, maybe because of this?
Everyone's time is different. Start without rushing from afar. 1. Check what the OrdersTotal function gives you. Its value depends on history settings: Today, last 3 days, last week, ... Adjust it as you prefer. 2. Then create a cycle and output all orders with Alert. This is called debugging - it is a very important part of a programmer's work. More important than writing code.
Everyone's time is different. Start without rushing from afar. 1. Check what the OrdersTotal function gives you. Its value depends on the history settings: Today, last 3 days, last week, ... Adjust it as you want. 2. Then create a cycle and output all orders using Alert. This is called debugging - it is a very important part of a programmer's work. More important than writing code.
Thank you !
Can you guys tell me how to write in the code of the Expert Advisor to open 3 trades at once with the ability to set SL?
Here is my condition
I was advised to use (OrdersTotal()) function, but it does not fit in my case. I have it like this
It compiles well, no errors, but it is not appropriate for my case.
I found the following code
Maybe it can be used, but I don't understand the meaning of strings. May this code be used when rewritten to fit my condition?
Can you guys tell me how to write in the code of the Expert Advisor to open 3 trades at once with the ability to set SL?
Here is my condition
I was advised to use (OrdersTotal()) function, but it does not fit in my case. I have it like this
It compiles well, no errors, but it is not appropriate for my case.
I found the following code
Maybe it can be used, but I don't understand the meaning of strings. Can I use this code if I rewrite it to fit my condition?
Try it this way
pos=0; //order counter
for(int i=OrdersTotal()-1;i>=0;i--) //read market orders
{
if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))continue;//select from the market orders
{
if (OrderSymbol()!=Symbol()&&OrderMagicNumber()!=Magic) continue;//select only EA orders (if there is Magic and it trades on any currency pair)
pos++; //if we have selected, then increase pos by one
}
}
Can you guys tell me how to write in the code of the EA to open 3 trades at once with the ability to set SL?