Artyom Trishkin: How can I replace the quadruple MODE_MARGINREQUIRED in mql5?
This is something you need to ask the developers, because none of the forum members do not know. I asked this question 4 times in different threads, once even got the answer: "use the search", but the search has more than 100 questions, and there is not a single answer. The developer does not answer the question, probably because there is no way to get the margin for pairs other than the deposit currency .
All is still raw in Five and looks like it will stay this way, but there is an OpenGL for everybody =)
By creating an appropriate file in advance.
With this implementation it is convenient/fast, for example, to copy arrays of any size (and different) into each other - without raping HDD/SDD.
#define ARRAYCOPY(Dest, Source) \
if (ArraySize(Source) > 0) \
{ \
const int handleRAM = FileOpen("\\\\REN\\pipe\\RAM", FILE_READ | FILE_WRITE | FILE_BIN); \
\
if (handleRAM != INVALID_HANDLE) \
{ \
if (FileWriteArray(handleRAM, Source) > 0) \
FileReadArray(handleRAM, Dest); \
\
FileClose(handleRAM); \
} \
}
#define MATRIX_TO_VECTOR(Matrix, Vector) \
if (ArraySize(Matrix) > 0) \
{ \
const int Range1 = ArrayRange(Matrix, 0); \
const int Range2 = ArrayRange(Matrix, 1); \
\
ArrayResize(Vector, Range1 * Range2); \
\
int k = 0; \
\
for (int i = 0; i < Range1; i++) \
for (int j = 0; j < Range2; j++) \
{ \
Vector[k] = Matrix[i][j]; \
\
k++; \
} \
}
// Копирует одномерный массив в двумерный
#define VECTOR_TO_MATRIX(Vector, Matrix) \
if (ArraySize(Vector) > 0) \
{ \
const int Size = ArraySize(Vector); \
const int Range = ArrayRange(Matrix, 1); \
\
ArrayResize(Matrix, Size / Range + ((Size % Range == 0) ? 0 : 1)); \
\
for (int i = 0; i < Size; i++) \
Matrix[i / Range][i % Range] = Vector[i]; \
}
The point is that OnTradeTransaction() is not triggered immediately after OrderSend.
In short, there's just a bunch of people who like to argue without getting into the subject of the argument.
There are two variants of the algorithm, if after OrderSend() something must be done immediately:
1. We can start a loop waiting for updates of the lists of orders and deals.
2. Finish OnTick() and wait for OnTradeTransaction() to take effect.
3. Check by tick to see if a new order or trade appears in the list.
How can I replace the quadruple MODE_MARGINREQUIRED in mql5?
This is something you need to ask the developers, because none of the forum members do not know. I asked this question 4 times in different threads, once even got the answer: "use the search", but the search has more than 100 questions, and there is not a single answer. The developer does not answer the question, probably because there is no way to get the margin for pairs other than the deposit currency .
All is still raw in Five and looks like it will stay this way, but there is an OpenGL for everybody =)
What can replace quadruple MODE_MARGINREQUIRED in mql5?
OrderCalcMargin() try
This is understandable, but it does not work with the indicator
OrderCalcMargin(ORDER_TYPE_BUY,Symbol(),1.0,SymbolInfoDouble(Symbol(),SYMBOL_ASK),One_Lot);
Comment(One_Lot); // залог на 1 лот
This is understandable, but it does not work with the indicator
OrderCalcMargin(ORDER_TYPE_BUY,Symbol(),1.0,SymbolInfoDouble(Symbol(),SYMBOL_ASK),One_Lot);
Comment(One_Lot);
It is written directly in the help that does not work from the indicator https://www.mql5.com/ru/docs/runtime/running.
I would like a calculation that does not depend on the type of program.
Ooh, I would also like a lot :)