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

Share your knowledge in the forex community!

Our community is a completely independent place for communication between forex traders and software developers for trading platforms Metatrader 4 and Metatrader 5

Create A New Account
Home/ Questions/Q 3818
Next
In Process
hoz
hoz

hoz

  • 16 Questions
  • 22 Answers
  • 0 Best Answers
  • 32 Points
View Profile
  • 0
hoz
Asked: December 26, 20202020-12-26T13:52:58+00:00 2020-12-26T13:52:58+00:00In: Forex Expert Advisors

Invalid price

  • 0

I thought I would never have such a mistake. But, as it turned out, it happened. On several DC, including Alpari, I have been working on everything for several years. Today, I decided to throw an owl on Roboforex for some reasons. It turned out that there the owl refuses to trade from the first signal. The reason is quite strange and, at the moment, remains a mystery to me.

Here’s what I see in the terminal:

2018.08.15 14:20:39.810 2016.01.06 19:25:03   __LastError = 4756
2018.08.15 14:20:39.810 2016.01.06 19:25:03   m_request.price = 173.398
2018.08.15 14:20:39.810 2016.01.06 19:25:03   failed buy stop 0.10 GBPJPY.m at 173.398 tp: 173.528 [Invalid price]
2018.08.15 14:20:39.810 2016.01.06 19:25:03   _LastError = 4756
2018.08.15 14:20:39.810 2016.01.06 19:25:03   OrdersHandling::put { order wasn't sent! m_result.retcode = '10015' | orderType = 'ORDER_TYPE_BUY_STOP' | price = '173.398' | SL = '0.000' | TP = '173.528' | ask = '173.364' | bid = '173.344' | spread = '0.020' }
2018.08.15 14:20:39.810 2016.01.06 19:25:03   OrdersHandling::put { _LastError = '4756' }

In other words, the server tells us that the reason is allegedly incorrect price, but the price is correct. I explain. Here is the section of code where the trading order is set:

    if (!sent) {
    Print("__LastError = ", _LastError);
    Print("m_request.price = ", dToS(m_request.price));
      sent = OrderSend(m_request, m_result);
    Print("_LastError = ", _LastError);
      Sleep(250); cnt++; continue;
    }

At the time of installation, we have the following data:

Opening price of a pending order of the BUY_STOP type = 173.398

Ask = 173,364

spread = 0,020

It turns out that from the price of setting a stop long order to Ask there is a margin = 173.398-173.364 = 0.034

The StopLevel and frizzlevel checks have been completed up to this point. What is stopping him then at all?

By the way, all my prices are normalized both by tick and by the number of decimal places of the symbol price. Accordingly, I showed the incoming price from the journal.

  • 4 4 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    4 Answers

    • Voted
    • Oldest
    • Recent
    1. hoz

      hoz

      • 16 Questions
      • 22 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      hoz
      2020-12-26T13:53:19+00:00Added an answer on December 26, 2020 at 1:53 pm

      In General, I have this question decided on the same day when I came across it. There was a kasyak in the class that is responsible for implementing trade orders, checks, and so on related to this. Not correct was realizovan unit test for StopLevel. On Alpari, stopLevel= 0, so I didn’t come across it. And on the Rob on GBPJPY, it seems to be 8. As a result, I corrected this block and everything is clear now. There was an idea to check one thing on a swap-free account. But with such a StopLevel, this is not an option. I scored. I switched to other thoughts.

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

      simakovva

      • 0 Questions
      • 7 Answers
      • 0 Best Answers
      • 34 Points
      View Profile
      simakovva
      2020-12-26T13:53:12+00:00Added an answer on December 26, 2020 at 1:53 pm

      Viktar Dzemikhau:

      I thought I would never have such a mistake. But, as it turned out, it happened. On several DC, including Alpari, I have been working on everything for several years. Today, I decided to throw an owl on Roboforex for some reasons. It turned out that there the owl refuses to trade from the first signal. The reason is quite strange and, at the moment, remains a mystery to me.

      Here’s what I see in the terminal:

      In other words, the server tells us that the reason is allegedly incorrect price, but the price is correct. I explain. Here is the section of code where the trading order is set:

      At the time of installation, we have the following data:

      Opening price of a pending order of the BUY_STOP type = 173.398

      Ask = 173,364

      spread = 0,020

      It turns out that from the price of setting a stop long order to Ask there is a margin = 173.398-173.364 = 0.034

      The StopLevel and frizzlevel checks have been completed up to this point. What is stopping him then at all?

      By the way, all my prices are normalized both by tick and by the number of decimal places of the symbol price. Accordingly, I showed the incoming price from the journal.

      And what type of performance does Roboforex have? It seems, as I remember, at the dawn of communication with MT5, I also ran into this, although I don’t remember anymore.

      In General, try not to specify price in MqlTradeRequest at all, let 0 be. And, for the future, do an execution type check and, only if it is at streaming prices or on demand, specify price.

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

      fxsaber

      • 1 Question
      • 53 Answers
      • 0 Best Answers
      • 140 Points
      View Profile
      fxsaber
      2020-12-26T13:53:07+00:00Added an answer on December 26, 2020 at 1:53 pm

      Probably ran into [No prices]

      Forum on trading, automated trading systems and testing of trading strategies

      Libraries: MT4Orders

      fxsaber, 2018.07.24 09:46

      2018.07.24 10:24:19.177 Trades  '35247942': market buy 0.01 USDHKD
      2018.07.24 10:24:19.246 Trades  '35247942': failed market buy 0.01 USDHKD [No prices]
      2018.07.24 10:24:19.246 Trades  '35247942': buy limit 0.01 USDHKD at 7.83618
      2018.07.24 10:24:19.315 Trades  '35247942': failed buy limit 0.01 USDHKD at 7.83618 [No prices]
      2018.07.24 10:24:19.316 Trades  '35247942': buy stop 0.01 USDHKD at 7.85618
      2018.07.24 10:24:19.384 Trades  '35247942': failed buy stop 0.01 USDHKD at 7.85618 [No prices]

      What are the entries in the log of the Terminal itself?

      And you need to understand whether it is the server or the Terminal (OrderCheck). This can be done by comparing the time of sending the order and the response. If it matches up to MS-OrderCheck. Well, if OrderCheck, then the problem becomes local and it will be easier to understand.

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

      dimeon

      • 2 Questions
      • 24 Answers
      • 0 Best Answers
      • 74 Points
      View Profile
      dimeon
      2020-12-26T13:53:02+00:00Added an answer on December 26, 2020 at 1:53 pm

      Viktar Dzemikhau:

      I thought I would never have such a mistake. But, as it turned out, it happened. On several DC, including Alpari, I have been working on everything for several years. Today, I decided to throw an owl on Roboforex for some reasons. It turned out that there the owl refuses to trade from the first signal. The reason is quite strange and, at the moment, remains a mystery to me.

      Here’s what I see in the terminal:

      In other words, the server tells us that the reason is allegedly incorrect price, but the price is correct. I explain. Here is the section of code where the trading order is set:

      At the time of installation, we have the following data:

      Opening price of a pending order of the BUY_STOP type = 173.398

      Ask = 173,364

      spread = 0,020

      It turns out that from the price of setting a stop long order to Ask there is a margin = 173.398-173.364 = 0.034

      The StopLevel and frizzlevel checks have been completed up to this point. What is stopping him then at all?

      By the way, all my prices are normalized both by tick and by the number of decimal places of the symbol price. Accordingly, I showed the incoming price from the journal.

      Perhaps at the time of processing the order by the server, the price has already changed and the StopLevel or frizzlevel has been violated. Try to increase the distance and then move the order to the right place. And in Print output not only the error number but also the current price + StopLevel *_Point.

      • 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 514
    • Answers 2k
    • Posts 5
    • Comments 0
    • Best Answers 0
    • Users 921
    • Popular
    • Answers
    • Tags
      • On: December 18, 2020
      • Answers: 16

      How to allow trading at certain times

      • On: December 29, 2020
      • Answers: 16

      Example of implementing the OOP pattern Abstract Factory using MQL5 ...

      • On: December 18, 2020
      • Answers: 15

      EMA with a different formula

      • On: December 29, 2020
      • Answers: 15

      Invitation for algo traders.

      • On: December 29, 2020
      • Answers: 14

      Dear Programmers, do not pass by, help fix the error!

    • atma1
      atma1 added an answer Added activation. Thanks. April 8, 2021 at 6:54 am
    • iks_
      iks_ added an answer Atma1: Good day, dear colleagues. Yesterday I updated VMware to… April 8, 2021 at 6:54 am
    • renat
      renat added an answer Atma1: Good day, dear colleagues. Yesterday I updated VMware to… April 8, 2021 at 6:54 am
    • mvs
      mvs added an answer Renat Fatkhullin: You can not immediately send the received data,… April 8, 2021 at 6:53 am
    • anton_m
      anton_m added an answer Renat Fatkhullin: How much data do you read? You can… April 8, 2021 at 6:53 am
    analytics british company computer developers django employee employer english facebook french google interview javascript language life php proforexea programmer programs pro vsa salary university

    Related Questions

    • atma1

      Yesterday I updated VMware to version 16.1.0 and the product ...

      • 3 Answers
    • anton_m

      It is not possible to read data from the server ...

      • 6 Answers
    • s22aa

      Tell me what the difference is.

      • 2 Answers
    • areedbreen

      on the chart in the tester one yield and in ...

      • 2 Answers
    • 1006293

      A question about the intersection of moving averages in MQL5

      • 3 Answers

    Users

    atma1

    atma1

    • 1 Question
    • 1 Answer
    s22aa

    s22aa

    • 1 Question
    • 1 Answer
    areedbreen

    areedbreen

    • 1 Question
    • 1 Answer

    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