Questions from Beginners MQL5 MT5 MetaTrader 5 - page 625

 
Karputov Vladimir:

No, I don't. Why, when there is MetaTrader 5, which has both netting and hedging and can be traded on real exchanges?

Is it really impossible to find a position by lot volume in mql4?

I doubt it.

And there's still a long way to go before trading on an exchange)

 
mila.com:

Is it not possible to find a position by lot volume in mql4.

...

Not for me personally, as I do not comment on MetaTrader 4. I only help with the modern MetaTrader 5 terminal.
 
Karputov Vladimir:
I personally do not, as I do not comment on MetaTrader 4. I only help with the modern MetaTrader 5 terminal.

We can only hope for help from someone who has not yet forgotten mql4.

 
Karputov Vladimir:
This is a check to return the function. If it fails, it returns 0, i.e. it is an error.

Don't you carry an umbrella in sunny weather? I'm tempted to make another comparison, but it's not quite decent. No offense.

Next condition.

if(position_lot==lot)

excludes the continuation of the code inside the brackets, as well as the condition

if(position_lot!=0)

And in your version, I imagine this is a possibility:

Another piece of code.

      string name=PositionGetSymbol(i);
      if(name==NULL)
        {
         Print("PositionGetSymbol Error# ",GetLastError());
         return;
        }

We have 5 positions of different characters. Suddenly a failure occurs at the second position and the script terminates. So, what? Are there 3 positions left unchecked?


Look, if mql5 is capable of such unsuccessful functions, maybe you'd better not work with it. If the connection with the server is broken or the screen turns blue, it's another situation.

 
Karputov Vladimir:
I personally do not, as I do not comment on MetaTrader 4. I only help with the modern MetaTrader 5 terminal.
Tell me please. Does anyone make money on this **** exchange or not. I have a friend who does not talk like a fish.
 
mila.com:

One can only hope for help from someone who has not yet forgotten mql4.


           int i, total = OrdersTotal();
            for(i = 0; i < total; i++)
             {
              if(OrderSelect(i, SELECT_BY_POS) && OrderSymbol() == Symbol() && OrderLots() == 0.1)
               {
                // тут нужный код
               }
             }
 
Alexey Viktorov:


It is impossible to foresee absolutely all cases. But writing naked code, without a single check, is also wrong.

 
Karputov Vladimir:

It is impossible to foresee absolutely all cases. But writing naked code, without a single check, is also wrong.

Vladimir, I don't argue with that, but the redundancy spoils the whole look too.
 
Alexey Viktorov:
Vladimir, I don't argue with that, but excesses also spoil the whole look.
Not without inspections. Things happen. One time you don't check, the second time, and on the thousandth time, you get a very unpleasant situation.
 
Karputov Vladimir:
You can't do it without a check-up. Things happen. One time you don't check, one time you don't check, and the thousandth time you get a very unpleasant situation.

Well, yes. My sister lives in a house with an ambulance on the ground floor... Something made her husband sick and he decided to go to the doctors on his own...

Forgive me... I should have sat in the waiting room...

It's not flooding, it's just comparing it to unnecessary checks in the code.

Reason: