Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1535

 
MrBrooklin immediate execution of a transaction at the current bid or offer price, depending on the type of its execution;
  • a pending order is an order (instruction) to make a deal in the future at a price specified by the trader that differs from the current market price.
  • The server checks the order for correctness (correctness of prices, availability of funds on the account, etc.);
  • Orders that have passed the check are waiting for their further processing on the trading server. Further the order can be:
    • executed (in one of the automatic execution modes or by a dealer);
    • cancelled after expiry of the validity time;
    • rejected (for example, in case of lack of money or absence of a suitable offer on the market);
    • cancelled by the trader himself;
  • If the trader (or advisor) has sent an order (order, instruction) for immediate execution of the order (i.e. market order) to the server of the brokerage company, then a new position will be opened immediately after the transaction in the corresponding financial instrument.
  • If a trader (or advisor) has sent an order (order, instruction) to the brokerage company's server to execute an order in the future (i.e. a pending order), then after the current price reaches the price level specified by the trader in the pending order, this order will "trigger", then the transaction will be executed and a new position will be opened immediately;
  • If there is an already open position on a financial instrument, the result of the transaction may be an increase or decrease in the volume of the position, its closing or reversal.

  • Please respond with constructive criticism. ))

    Regards, Vladimir.

    The word new is superfluous (new position old as it is too differently can be interpreted)))). And what does the coup mean? You can't put it into one deal and why should it be singled out separately? Besides, in currencies it is difficult and in stocks or commodities it is even more difficult, what does it mean to reverse a position on a commodity or stock? You can't do it without secondary instruments)))))) So it is also unnecessary)))))

     
    Valeriy Yastremskiy #:

    The word new is superfluous (new position old as too different can be interpreted too differently)))) And what does the flip mean? You can't put it into one deal and why should it be separated? Besides, in currencies it is difficult and in stocks or commodities it is even more difficult, what does it mean to reverse a position on a commodity or stock? You can't do it without secondary instruments)))))) So it is also unnecessary)))))

    Thanks, Valery! I will remove the words "new". And about the rollover - it concerns only netting and I took it from MetaTrader 5 Help. )) Probably I should have added in brackets after the word " overturn " (applies only to netting).

    Regards, Vladimir.

     
    Valeriy Yastremskiy #:

    The word new is superfluous (new position old as it is too different can be interpreted too differently)))) And what does the coup mean? You can't put it into one deal and why should it be separated? Besides, in currencies it is difficult and in stocks or commodities it is even more difficult, what does it mean to reverse a position on a commodity or stock? You can't do it without secondary instruments)))))) So it is also unnecessary)))))

    In net position accounting. There was a 1.0 Buy position. Sold 1.5 lots. What will be the position? That's right: 0.5 Sell. That's the flip.
     
    maxvoronin74 #:
    Today I tried to understand why positions are not closed according to the Expert Advisor's logic. There is neither a log file for today, nor records in the journal. Although there are closed trades in the history. I contacted the broker, reinstalled the terminal. Nothing has changed. And the broker advises to contact the forum or the developers.... Who can advise?

    Try to run the period when EA didn't close any positions in Tester to see if the problem is with the live trading.

    Then run it with "Delays" --> "Random delay" and "Modelling" --> "All ticks" options.

    And of course you'll need to provide some logs/code if you want to see a meaningful answer.

     
    Artyom Trishkin #:
    In net position accounting. There was a 1.0 Buy position. Sold 1.5 lots. What will the position become? That's right: 0.5 Sell. That's a flip.

    The way I see it, a flip is Xbye became Xcell. And that's a volume change. So the sign's changed, so what. That's why I wouldn't single it out as a separate action. But Quota knows better))))

     
    Alexey Viktorov #:

    It is possible that the sufficiency of funds is checked twice, both in the terminal and on the broker's server.

    there is a reason why there is no word "broker" in the beautiful picture...because there is no broker there (there are no brokers in the MT infrastructure, in forex in general).

    and the word "market" should be put in inverted commas and blurred. Instead of market there are liquidity providers (and sometimes equal dealers), those who broadcast their big bet and with whom dealers have financial relations.

    sufficiency of funds is checked at least three times: in the terminal, on the DC server personally and once again cumulatively...whether the order will be broadcast to the DC peer or will be executed at the place, which (there can be more than 1), separately or in a common pile, you/me of course will not be informed :-) but of course the availability of funds for sharing will be checked by all parties

     
    Aleksey Vyazmikin #:

    Perhaps this case.

    Thank you. There about some operations not being performed. Maybe it is about the first part or the reason why I wanted to see the information in the log file. But the thing is that the manually closed operations did not affect the occurrence of the log file and were not displayed in the Expert Advisors tab. And the broker advised me to contact the forum or the developer about it. Actually, if the broker, and not me, decides what operations to be and what not to be, I hardly have any more opportunities to influence the situation and the sense to work in this sphere....

     
    Kristian Kafarov #:

    Try running the period when the EA has not closed any positions in the tester to see if the problem is related to real trading.

    Then run it with the options Delay --> Random Delay and Simulation --> All ticks.

    And of course you'll need to provide some logs/code if you want to see a meaningful answer.

    You can see the code as text on google drive: https://drive.google.com/file/d/1bSmNjmO71GYO6fYVFioJWOsFctmmeJTy/view?usp=drive_link

    I switched the tester on with no delay, then with random delay and 1000 milliseconds delay.

    With no delay, the first scan in the log tab. All ticks. With delays - the second scan. Also all ticks.

    Maybe I'm doing something wrong? Because apart from these records, there were no other changes. Nothing showed up on the graph either. I set the date to 3 May 24. That was a Friday. The logs didn't show up either. I don't know what to show you. They're gone.

     
    maxvoronin74 #:

    Thank you. There about some operations not being performed. Maybe it is about the first part or the reason why I wanted to see the information in the log file. But the thing is that the manually closed operations did not affect the occurrence of the log file and were not displayed in the Experts tab. And the broker advised me to contact the forum or the developer about it.

    The Expert Advisors tab contains mostly what is programmed in the Expert Advisor code. Perhaps, the code does not process errors of trade operations and messages about them - you can look for information in this direction.

    maxvoronin74 #:
    Actually, if the broker, not me, decides what operations to be and what not to be, I hardly have any more opportunities to influence the situation and the sense to work in this sphere....

    And this is a very sensible idea, which will save nerves and money.

     
    Aleksey Vyazmikin #:

    In the "Expert Advisors" tab, mostly what is programmed in the EA code is written. It is possible that the code does not handle errors of trade operations and messages about them - you can look for information in this direction.

    So opening and closing of a position is displayed in any case. It should be displayed. And it has always been so. Until now.

    Aleksey Vyazmikin #:

    This is a very sensible idea that will save nerves and money.

    It's sad. Already so much effort and time given.... It's a shame. Perhaps there are ways to participate in trading without a broker's layer. But I couldn't find anything on this topic.

    Reason: