fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    How to get the values sent to the broker server?

    Questions & Answers
    3
    5
    974
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      josecortesllobat last edited by

      Hi

      Please, could anyone help me to get the values sent by the EAs to the trading server?

      I would need a way to get the values sent by the EAs to the trading server and its response to be stored in a file or logged in the journal. Particularly the ones related to the OrderModify() command that is involved in blocks such as "Modify Stops".

      The issue is that I am having some problems with the SL/TP shift in a demo account that is not happening in the backtest. The SL/TP are not shifted when the conditions to do it are met and there is no error logged in the journal. So, what I would like to know is when a condition to move the positions' SL is triggered what values are sent to the server and its response if the order has been done correctly or if there is an error.

      Condition block triggered -> Send Order to modify SL & Log values sent -> Get the server's response and Log (or save) it

      Is that posible using a block or a MQL custome code?

      Any help on this issue will be very welcome.

      Thanks

      1 Reply Last reply Reply Quote 0
      • roar
        roar last edited by

        I dont think any EA has access to the terminal behavior, I might be wrong though..

        Your problem probably is because your broker doesn't allow super-small stops - try some bigger stops, does them work?

        Another workaround would be to use virtual stops - don't tell your broker the stop levels, just use some variables and automate the closing in the EA.

        Need small help? Tag me in your post
        Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

        1 Reply Last reply Reply Quote 0
        • J
          josecortesllobat last edited by

          Hi @roar

          Thanks for your answer.

          I don't know which is the problem. If the stop level modify request is not allowed, it should be logged in the journal as it did in the backtesting saying "Invalid SL/TP requested".

          0_1525856976924_4f74630d-14da-4e0d-874e-f552d3f2d37b-image.png

          Per my fxDreema's code, the modify request is sent over and over again in each new bar if the first condition to move the SL is not allowed. If each request returns an error a new log is written in the trading journal. But in the demo account, nothing is logged not even the order's modify request.

          Service desk of my broker suggested to use the Print() function to get the values sent. But I am not a coder and I don't know how to use it or code it and to get what values are sent with the OrderModify command.

          I will try the workaround you suggested to see what happens.

          Thanks

          1 Reply Last reply Reply Quote 0
          • fxDreema
            fxDreema last edited by

            When the EA sends a request to the server, this action should be logged. Otherwise there is no request to the server, most probably. In the modify blocks I have some checks, so that modify request is only sent when needed. For example, if you want to modify SL and TP with the same levels, nothing is sent to the server, because the stops are already on the requested levels.

            Also make sure that the EA is actually working and allowed to trade. The "Auto Trading" button should be green.

            1 Reply Last reply Reply Quote 0
            • J
              josecortesllobat last edited by

              Hi @fxDreema

              I am asking this because of what I explain in the next post

              https://fxdreema.com/forum/topic/5845/eas-working-together-could-there-be-confusion-in-the-price-values-sent-or-received/13

              When 2 EAs open a trade at the same time, it seems that the TP values are confused in one of them.

              Please, take a look at that post.

              Thanks for your help.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post

              Online Users

              G
              K
              P
              M
              M

              20
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors