Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

First independent community of traders

First independent community of traders Logo First independent community of traders Logo

First independent community of traders Navigation

  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • Buy Theme
  • Home
  • About Us
  • Blog
  • Contact Us
Home/ Questions/Q 918
In Process
edprivy
edprivy

edprivy

  • 1 Question
  • 1 Answer
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
edprivy
Asked: December 18, 20202020-12-18T09:56:01+00:00 2020-12-18T09:56:01+00:00

Help me fix the error (checking for a deal)

  • 0

Hello everyone

On my request, a friend wrote “trading robot”. Everything would be fine, but there is a problem or error. We don’t know how to fix it.

The problem is as follows-the Expert Advisor is given a pair of options for opening a trade. It is worth checking for magicid, that is, if the transaction is already open,
then do not open a new one. But there are such moments (when the connection to the server jumps or the market is closed/opened), the robot sends a request to
open a trade, but does not receive a response. Sends again-again silence. And now the connection is restored and all requests sent to
open a deal and not waiting for a response are opened. why does the magicid check not work? 30-40 open trades in one direction per day
1-2 seconds is very, very fraught. maybe we did something crooked? Good people, please tell me what is wrong and how to fix it? 

  • 7 7 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    7 Answers

    • Voted
    • Oldest
    • Recent
    1. trendhunter

      trendhunter

      • 0 Questions
      • 22 Answers
      • 0 Best Answers
      • 64 Points
      View Profile
      trendhunter
      2020-12-22T07:02:42+00:00Added an answer on December 22, 2020 at 7:02 am

      Alexey Viktorov:

      maybe i’m tired of complaining))) or convinced of the failure of the strategy.

      no, i remembered how it was. It was a long time ago, I was making my first steps in MQL5. I did it with the help of an article here on the site. And there it was written?
      what is trade. setasyncmode(true).
      Here is this true I made false and everything is fine.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. ya_programmer

      ya_programmer

      • 0 Questions
      • 23 Answers
      • 0 Best Answers
      • 68 Points
      View Profile
      ya_programmer
      2020-12-18T09:56:39+00:00Added an answer on December 18, 2020 at 9:56 am

      perhaps you have an asynchronous mode of opening transactions, use synchronous

      make a check for the number of open trades and prohibit opening more than necessary

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    3. alexeyvik

      alexeyvik

      • 1 Question
      • 74 Answers
      • 0 Best Answers
      • 172 Points
      View Profile
      alexeyvik
      2020-12-18T09:56:35+00:00Added an answer on December 18, 2020 at 9:56 am

      Evgeniy Zhdan:
      I don’t know. He never complained to me again

      maybe i’m tired of complaining))) or convinced of the failure of the strategy.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    4. trendhunter

      trendhunter

      • 0 Questions
      • 22 Answers
      • 0 Best Answers
      • 64 Points
      View Profile
      trendhunter
      2020-12-22T07:02:42+00:00Added an answer on December 22, 2020 at 7:02 am

      Alexey Viktorov:

      this probably won’t help. judging by the inexperience of the performer, he had not heard of this. and by default, asychrony is disabled.

      Not disabled. I once made a robot for a person, I did not specify this asynchrony at all. And it sometimes opened a lot of
      orders for him. Although all the checks for quantity and all that have been done. I implemented trade. setasyncmode(false)
      and it helped.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    5. alexeyvik

      alexeyvik

      • 1 Question
      • 74 Answers
      • 0 Best Answers
      • 172 Points
      View Profile
      alexeyvik
      2020-12-18T09:56:20+00:00Added an answer on December 18, 2020 at 9:56 am

      Evgeniy Zhdan:

      I think this one will help:

      At the beginning of the code, after #property, for example, refer to the trade class, if it is not already done by your esteemed
      as a programmer:

      Then in the OnInit():

      This should already be enough to solve your problem

      this probably won’t help. judging by the inexperience of the performer, he had not heard of this. and by default, asychrony is disabled.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    6. edprivy

      edprivy

      • 1 Question
      • 1 Answer
      • 0 Best Answers
      • 20 Points
      View Profile
      edprivy
      2020-12-18T09:56:10+00:00Added an answer on December 18, 2020 at 9:56 am

      Evgeniy Zhdan:
      Wait for the server response code
      before sending the next request. And just in case, turn off asynchrony or whatever it is right

      Eugene, thank you for your answer. And how do I make the robot wait for a response before sending the next request? I don’t write the robot, I know it writes, but
      it works in other languages. Please tell me what he needs to insert into the code to get rid of this problem.

      Thank you in advance.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    7. trendhunter

      trendhunter

      • 0 Questions
      • 22 Answers
      • 0 Best Answers
      • 64 Points
      View Profile
      trendhunter
      2020-12-22T07:02:43+00:00Added an answer on December 22, 2020 at 7:02 am

      Ed Privy:

      Hello everyone

      On my request, a friend wrote “trading robot”. Everything would be fine, but there is a problem or error. We don’t know how to fix it.

      The problem is as follows-the Expert Advisor is given a pair of options for opening a trade. it is worth checking for magicid, that is, if the transaction is already made
      if it is open, then do not open a new one. but there are such moments (when the connection to the server or the market jumps
      closed/opened) the robot sends a request to open a trade, but does not receive a response. Sends again-again silence.

      Wait for the server response code before sending the next request. And just in case, turn off asynchrony or whatever it is right

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    Stats

    • Questions 504
    • Answers 2k
    • Posts 5
    • Comments 0
    • Best Answers 0
    • Users 673
    • Popular
    • Comments
    • Tags
    • forexcommunity

      Highlighting what’s important about questions & Answers on Discy Community!

      • 0 Comments
    • forexcommunity

      Introducing Keyboard Shortcuts, our first Labs feature

      • 0 Comments
    • forexcommunity

      Defining quality on Discy Engine — what a helpful answer ...

      • 0 Comments
    • forexcommunity

      Organizational and company accounts on Discy Engine the next step

      • 0 Comments
    • forexcommunity

      Hello world!

      • 0 Comments

    Users

    Brus Agell

    Brus Agell

    • 1 Question
    • 0 Answers
    pinupcasinoo

    pinupcasinoo

    • 1 Question
    • 0 Answers
    JamesSwics

    JamesSwics

    • 0 Questions
    • 0 Answers

    Footer

    First independent community of traders

    About

    An independent community of forex traders. This is where traders communicate. You can ask your questions and you will receive an answer to your question.
    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Knowledge Base
    • Support

    © 2021 Forexcommunity.net. All Rights Reserved