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 5152
Next
In Process
nx0x2
nx0x2

nx0x2

  • 1 Question
  • 4 Answers
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
nx0x2
Asked: December 29, 20202020-12-29T09:31:04+00:00 2020-12-29T09:31:04+00:00In: Forex Expert Advisors

Not possible to set the expiration of the order.

  • 0

Colleagues, kind time of day.

I try to set the expiration of the order, but in response I get: invalid expiration type.
The code looks like this:
datetime expir=TimeTradeServer()+PeriodSeconds(PERIOD_M5);

ct.BuyLimit(vol,price,sym1,0,0,ORDER_TIME_SPECIFIED,expir);

Please help.
Thanks.

  • 11 11 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    11 Answers

    • Voted
    • Oldest
    • Recent
    1. barabashkakvn

      barabashkakvn

      • 7 Questions
      • 162 Answers
      • 0 Best Answers
      • 314 Points
      View Profile
      barabashkakvn
      2020-12-29T09:32:16+00:00Added an answer on December 29, 2020 at 9:32 am

      Comments that are not related to this topic have been moved to the “Issue with expiration on FORTS”.

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

      nx0x2

      • 1 Question
      • 4 Answers
      • 0 Best Answers
      • 20 Points
      View Profile
      nx0x2
      2020-12-29T09:32:09+00:00Added an answer on December 29, 2020 at 9:32 am

      prostotrader:

      I wrote that there are only two types.

      If you want for 5 minutes, then you need to use a timer

      and SYMBOL_EXPIRATION_DAY mode

      Added

      When placing an order, you mark the current time, and then, after 5 minutes, delete the order

      Added

      But from my own experience I would say that to set the order on time is a bad idea, 

      It is easier to place and delete orders depending on the trading situation.

      DO NOT forget that FORTS has a limit on the number of orders per trading day (2000),

      if more than this number – the exchange imposes a fine

      Added

      Trading day FORTS from 19-00 of the current day, to 18-45 of the next

      Thank you very much)

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

      prostotrader

      • 0 Questions
      • 16 Answers
      • 0 Best Answers
      • 56 Points
      View Profile
      prostotrader
      2020-12-29T09:31:58+00:00Added an answer on December 29, 2020 at 9:31 am

      nx0x2:

      Returns the value 10, in the tablature (flags of allowed modes) I did not find anything on this topic

      Write what you want to do (for how long to set the order)?

      A value of 10 means that this symbol supports 2 types of expiration

      SYMBOL_EXPIRATION_DAY and SYMBOL_EXPIRATION_SPECIFIED_DAY

      Added

      Ie EXPIRATION_SPECIFIED_DAY You can place an order before the first clearing on the day you set,

      and SYMBOL_EXPIRATION_DAY – to the nearest clearing

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

      nx0x2

      • 1 Question
      • 4 Answers
      • 0 Best Answers
      • 20 Points
      View Profile
      nx0x2
      2020-12-29T09:31:53+00:00Added an answer on December 29, 2020 at 9:31 am

      Stanislav Korotky:

      It is necessary to make a check for the availability of the expiration setting – not all symbols have it enabled – symbolinfointeger (, SYMBOL_EXPIRATION_MODE) – will return the mask of flags of allowed modes.

      Returns the value 10, in the tablature (flags of allowed modes) I did not find anything on this topic

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

      fxsaber

      • 1 Question
      • 54 Answers
      • 0 Best Answers
      • 134 Points
      View Profile
      fxsaber
      2020-12-29T09:31:43+00:00Added an answer on December 29, 2020 at 9:31 am

      nx0x2:

      Error modification of the order. Error code=4753

      Trading server, symbol?

      Perhaps it will be decided so

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

      Features of the mql5 language, subtleties and techniques of work

      fxsaber, 2017.02.25 16:16

      // Returns the order expiration type equal to Expiration if it is available on the symbol Symb, otherwise it is the correct option.
      ENUM_ORDER_TYPE_TIME GetExpirationType( const string Symb, uint Expiration = ORDER_TIME_GTC )
      {
        const int ExpirationMode = (int)::SymbolInfoInteger(Symb, SYMBOL_EXPIRATION_MODE);

        if ((Expiration > ORDER_TIME_SPECIFIED_DAY) || (((ExpirationMode >> Expiration) & 1) == 0))
        {
          if ((Expiration < ORDER_TIME_SPECIFIED) || (ExpirationMode < SYMBOL_EXPIRATION_SPECIFIED))
            Expiration = ORDER_TIME_GTC;
          else if (Expiration > ORDER_TIME_DAY)
            Expiration = ORDER_TIME_SPECIFIED;

          uint i = 1 << Expiration;

          while ((Expiration <= ORDER_TIME_SPECIFIED_DAY) && ((ExpirationMode & i) != i))
          {
            i <<= 1;
            Expiration++;
          }
        }

        return((ENUM_ORDER_TYPE_TIME)Expiration);
      }ApplicationRequest.type_time = getexpirationtype(Request.symbol, (uint)Expiration); // Expiration can be a datetime

      if (Expiration > ORDER_TIME_DAY)
        Request.expiration = Expiration;Such a changeis ct. BuyLimit(vol, price, sym1,0,0,getexpirationtype(sym1, (uint)expir), (expir > > ORDER_TIME_DAY)? expir : 0);

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

      nx0x2

      • 1 Question
      • 4 Answers
      • 0 Best Answers
      • 20 Points
      View Profile
      nx0x2
      2020-12-29T09:31:37+00:00Added an answer on December 29, 2020 at 9:31 am

      fxsaber:

      Error modification of the order. Error code=4753

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

      marketeer

      • 1 Question
      • 33 Answers
      • 0 Best Answers
      • 92 Points
      View Profile
      marketeer
      2020-12-29T09:31:32+00:00Added an answer on December 29, 2020 at 9:31 am

      nx0x2:

      Thank you, but for more than 10 minutes(1 hour), orders are still not placed.

      It is necessary to make a check for the availability of the expiration setting – not all symbols have it enabled – symbolinfointeger (, SYMBOL_EXPIRATION_MODE) – will return the mask of flags of allowed modes.

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

      fxsaber

      • 1 Question
      • 54 Answers
      • 0 Best Answers
      • 134 Points
      View Profile
      fxsaber
      2020-12-29T09:31:26+00:00Added an answer on December 29, 2020 at 9:31 am

      nx0x2:

      Thank you, but for more than 10 minutes(1 hour), orders are still not placed.

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

      When modifying an order, error 131 occurs

      fxsaber, 2017.09.12 19:47

      You just need to write the name of the trading server and the symbol, and the problem will be solved in the shortest possible time, because everyone will be able to try it.

      In the meantime, it seems that the task is not to find a solution, but to answer yes/no.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    9. nx0x2

      nx0x2

      • 1 Question
      • 4 Answers
      • 0 Best Answers
      • 20 Points
      View Profile
      nx0x2
      2020-12-29T09:31:19+00:00Added an answer on December 29, 2020 at 9:31 am

      rosomah:

      Thank you, but the method you suggested didn’t work. Moreover, when you set your method, the expiration time is 00: 00:00(the order is not set with the invalid expiration type), and if you set it like this:

      datetime expir=TimeCurrent()+300;..that time is displayed as it should be 00: 05: 00, while the order is still not placed with the error invalid expiration type

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    10. scriptong

      scriptong

      • 2 Questions
      • 37 Answers
      • 0 Best Answers
      • 94 Points
      View Profile
      scriptong
      2020-12-29T09:31:13+00:00Added an answer on December 29, 2020 at 9:31 am

      nx0x2:

      Colleagues, kind time of day.

      I try to set the expiration of the order, but in response I get: invalid expiration type.

      The code looks like this:

      Please help.

      Thanks.

      The expiration must be at least 10 minutes from the current time. And in the given example – 5 minutes.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    11. rosomah

      rosomah

      • 0 Questions
      • 5 Answers
      • 0 Best Answers
      • 30 Points
      View Profile
      rosomah
      2020-12-29T09:31:08+00:00Added an answer on December 29, 2020 at 9:31 am

      For example:
      input int t_ord=1;//t_ord=1; / /number of hours
      ...............
      datetime expir=TimeCurrent()+t_ord*3600;//3600-number of seconds in an hour

      ct.BuyLimit(vol,price,sym1,0,0,ORDER_TIME_SPECIFIED,expir);

      • 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 676
    • 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

    Related Questions

    • Brus Agell

      Правельный выбор

      • 0 Answers
    • pinupcasinoo

      Pin Up Casino

      • 0 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 2 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 0 Answers
    • c00l777

      Optimization results differ on different accounts

      • 3 Answers

    Users

    Geraldimaky

    Geraldimaky

    • 0 Questions
    • 0 Answers
    Jeffreytix

    Jeffreytix

    • 0 Questions
    • 0 Answers
    RobertFoeta

    RobertFoeta

    • 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