The great and terrible MT4 forever (or how to strategise a transition) - page 17

 
Andrey Khatimlianskii:

We are looking forward to it. If there is anything you need to help with, please write.

Everyone is welcome to check out the first release of the solution.

Библиотеки: TradesID
Библиотеки: TradesID
  • 2021.03.29
  • www.mql5.com
Статьи и техническая библиотека по автоматическому трейдингу: Библиотеки: TradesID
 
fxsaber:

Everyone is welcome to check out the first release of the solution.

It's a pity nobody has checked it on their configurations. Let's consider that the problem of position doubling has indeed been solved.

 
fxsaber:

It's a pity nobody has tested it on their own configurations. Let's assume that the problem of position doubling has indeed been solved.

Didn't see the point in just running the same test. It's not ticking now, can't check it.

 
Andrey Khatimlianskii:

I didn't see the point in just running the same test.

If someone's test doesn't work, then everyone else is going to run into trouble.

 

This is an interesting place:

else if (::HistoryOrderGetInteger(this.Orders[i], ORDER_TICKET) != this.Orders[i])

When and why might this inequality happen?

In general the code is not clear yet, I'll have to spend time on parsing it :/

I can't say it's easy and fast and can be called on every tick.

Instead of ByPass.Is(), you should try to call any other code which will execute in the same amount of time.

Or maybe the solution is just related to its execution time.

Maybe during this time all lists and quantities will naturally normalize?

 
Dmitry Fedoseev:

This is an interesting place:

When and why might this inequality happen?

In general the code is not clear yet, I'll have to spend time on parsing it :/

I can't say it's easy and fast and can be called on every tick.

Instead of ByPass.Is(), you should try to call any other code which will execute in the same amount of time.

Or maybe the solution is just related to its execution time.

Maybe all the lists and quantities will naturally normalize during this time?

Another option is to check on FORTS at 10AM sharp.

 
Dmitry Fedoseev:

It's an interesting place:

You've done well to duplicate your questions on the implementation itself in her thread. I'll answer it there.

 

I need to write a script on an MT5 that opens 100 positions on an empty account.


On MT4 solved it this way.

void OnStart()
{
  while (OrdersTotal() < 100)
    OrderSend(_Symbol, OP_BUY, 0.1, Ask, 0, 0, 0);
    
  Print(OrdersTotal());
}


Who has a solution on MT5?

 
fxsaber:

I need to write a script on an MT5 that opens 100 positions on an empty account.


On MT4 solved it this way.


Who has a solution on MT5?

How about this?

//+------------------------------------------------------------------+
//|                                                    maxLimits.mq5 |
//|                                  Copyright 2021, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#include <Trade\Trade.mqh>
//---
CTrade m_trade; // trading object
//---
uint maxLimits=100; // Кол-во Позиции Открыть в одну сторону
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   for(uint i=0; i<maxLimits; i++)
     {
      //--- open position
      if(m_trade.Buy(0.01))
         printf("Position by %s to be opened",_Symbol);
     }
  }
//+------------------------------------------------------------------+
Photo by
 
SanAlex:

Can you do that?

No.
The result is not guaranteed.