Features of the mql4 language, subtleties and techniques - page 25

 
Alexey Viktorov:

This is not a market - it is an ordinary close.

It is clear that there is always a market to close by hand. The question still remains - doall brokerage companies have a limit order? If not, what does it depend on - MT server settings and/or something else?

 
Aleksey Mavrin:

It is clear that there is always a market to close by hand. The question still remains - doall brokerage companies have a limit order? If not, what does it depend on - MT server settings and/or something else?

All of them.

Enough to understand the definitions: BuyLimit can only be below the current price. Take for Sell too, only below the current price. All other options are a work in progress on their own.

 
Aleksey Mavrin:

The question still remains - doall brokerage companies have a limit order?

No, look at the rules of the brokerage company on how to execute the limit and stop.

 
Andrei Trukhanovich:

No, look at the DC regulations on the execution of take and stops.

Could you ask for a more detailed answer? Examples, comparisons and other differences between a take and a limit order.

 
Alexey Viktorov:

And how did you compile this??? Don't you know that only the first dimension of an array can be dynamic???

ps; Sorry, but I won't delete this post. In mql4 it compiles even with #property strict

This fact more deserves the right to be in this thread.

The point is, in MQL4 it's only correct. Otherwise, the compiler cannot select the required overloading, if the second dimension value is specified explicitly. In MQL5 it can.

 
fxsaber:

The point is that in MQL4 this is the only correct way. Otherwise the compiler cannot select the right overload if the value of the second dimension is specified explicitly. In MQL5 it can.

Your example is a common example of what the user expects, and the result cannot be tracked even by analyzing GetlastError.

imho, some sizeof() must always work correctly, or both languages (MQL4/MQL5) must be aligned

 
Igor Makanu:

this is an ambiguous "so right", imho - your example is a common example of what the user expects - the result cannot be traced even by analyzing GetlastError

imho, some sizeof() must always work correctly, or both languages (MQL4/MQL5) must be aligned

In MQL4 the following is a classic

void Func( int &Array[][2] ) {}
void Func( int &Array[][5] ) {}

void OnStart()
{
  int Array[][2];
  
  Func(Array); // 'Func' - ambiguous call to overloaded function with the same parameters  
}

That's why I haven't even provided it. This is the correct way to do it.

The zero ArraySize, on the other hand, is a subtlety.
 
fxsaber:

But the zero ArraySize is a subtlety.

checked in C#

using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,] a = new int[5, 7];
            Console.WriteLine(ArraySize2(a));
            Console.ReadLine();
            
        }
        static int ArraySize2(int[,] arr ) 
        { 
            return (arr.Length); 
        }
    }
}

35

imho, this peculiarity borders on subtlety ))))

Still it is not explicit and requires constant checks while writing the code

 
Aleksey Mavrin:

The question still remains - doall brokerage companies have a limit switch? If not, what does it depend on - MT server settings and/or something else?

No, not all of them. Not so long ago I was unpleasantly surprised when a Take Profit was executed with negative (against me) slippage. It was on the news. Tech support explained that this is normal and limits (take profit by definition is a limit order) are executed as MIT (Market If Touched). In other words, when the price touches a limit order level, it is executed as a market order. Unpleasant of course, but there is nothing to do.

 
Hi all! I'm new here.... Is it realistic to make money here?