[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 364

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
I'm not a programmer. I've just been getting into it for the last six years. It's a sport. You have to win.
I'm not a programmer. I've just been getting into it for the last six years. It's a sport. You have to win.
So you are at the beginning of your way. In three years, if you are patient enough, you will realize that you have to create your own one. It does not resemble anything else.
MQL4 is very similar to C. C++ is a totally different language. With infinite possibilities.
I've read on forums who have been creating something of their own since 2000, and as I see nothing of substance has been created (otherwise I wouldn't be sitting on them). What not to create, and all the same takes as a basis for something commonly known (the wheel is not wooden now, but again, no one invents it).
I have read on the forums, who since 2000 has created something of their own, and as I see it did not create anything sensible (otherwise I would not have sat on them). What do not create, and all the same, based on something commonly known (the wheel is not wooden now, but again, no one invents it).
Vadim, do you have children, if it's not a secret?
Why, can you arrange it?
Sometimes it's better to just drink whiskey than to do shit... Too bad we're out of blue label.
Why, can you arrange it?
Sometimes it's better to just drink whiskey than to do shit... Too bad we're out of blue label.
Good afternoon!
I have a question: The EA is configured to trade on several dozen currency pairs (in a single pair window). If any of the pairs is not displayed in the Market Watch window, it causes a glitch. How can I programmatically check if these currency pairs are available to trade, or maybe they are just not displayed in the Market Watch?
Hello! Does anyone know how an EA can be prescribed on mt-4?
Is there a code where it needs to be prescribed for the EA to be displayed in mt?!
Thank you very much in advance!!!!!
Hello! Does anyone know how to register an EA on mt-4?!
Is there a code where it needs to be prescribed for the EA to be displayed in mt?!
Thank you very much in advance!!!!!
How do I select the position closest to the buy and sell price at the same time?
//+----------------------------------------------------------------------------+
//| Возвращает тикет ближайшей к рынку позиции по цене открытия или 0 |
//| Параметры: |
//| sym - наименование инструмента ("" - текущий символ) |
//| op - операция (-1 - любая позиция) |
//| mn - MagicNumber (-1 - любой магик) |
//+----------------------------------------------------------------------------+
int TicketNearPosOnOpen(string sym="", int op=-1, int mn=-1) {
double di=10000, pp;
int i, k=OrdersTotal(), t=0;
if (sym=="") sym=Symbol();
for (i=0; i<k; i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol()==sym && (op<0 || OrderType()==op)) {
if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
if (mn<0 || OrderMagicNumber()==mn) {
if (OrderType()==OP_BUY) pp=MarketInfo(sym, MODE_BID);
if (OrderType()==OP_SELL) pp=MarketInfo(sym, MODE_ASK);
if (di>MathAbs(OrderOpenPrice()-pp)) {
di=MathAbs(OrderOpenPrice()-pp);
t=OrderTicket();
}
}
}
}
}
}
return(t);
}
How do I select the position closest to the buy and sell price at the same time?
//+----------------------------------------------------------------------------+
//| Возвращает тикет ближайшей к рынку позиции по цене открытия или 0 |
//| Параметры: |
//| sym - наименование инструмента ("" - текущий символ) |
//| op - операция (-1 - любая позиция) |
//| mn - MagicNumber (-1 - любой магик) |
//+----------------------------------------------------------------------------+
int TicketNearPosOnOpen(string sym="", int op=-1, int mn=-1) {
double di=10000, pp;
int i, k=OrdersTotal(), t=0;
if (sym=="") sym=Symbol();
for (i=0; i<k; i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol()==sym && (op<0 || OrderType()==op)) {
if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
if (mn<0 || OrderMagicNumber()==mn) {
if (OrderType()==OP_BUY) pp=MarketInfo(sym, MODE_BID);
if (OrderType()==OP_SELL) pp=MarketInfo(sym, MODE_ASK);
if (di>MathAbs(OrderOpenPrice()-pp)) {
di=MathAbs(OrderOpenPrice()-pp);
t=OrderTicket();
}
}
}
}
}
}
return(t);
}
Define the term according to you "... The nearest to the buy and sell price at the same time..." - how does it mean simultaneity?
replace this penultimate line return(t); with this