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 4381
Next
In Process
hoz
hoz

hoz

  • 16 Questions
  • 22 Answers
  • 0 Best Answers
  • 32 Points
View Profile
  • 0
hoz
Asked: December 27, 20202020-12-27T05:11:28+00:00 2020-12-27T05:11:28+00:00In: Forex Expert Advisors

How do I create a flag for a file with runtime data?

  • 0

 If the bot trades on different trading instruments at once, and it has periods when there are several open orders at some point in time. In a class that receives a General trading signal, depending on various factors, I want to remember the dates and times of the bar on which the trading signal was received and, accordingly, the trade was made. So this data, i.e. the date and time of the bar on which the trading signal was received, can be steamed during the execution of the program, if, for example, the program is reinitialized, depending on some factors. I decided that they should be saved after a successful transaction. If you do not do this, after reinitializing the program, I will have a transaction made on the same signal that has already been worked out. And this is not an option.

I decided to write this data to a file. Everything is logical here. But there is one point!

Here, for example, there is a bot that is running on some thread currency instrument, let’s say, AUDEUR. The second bot is also running on the same trading instrument. But each bot trades its own trading tools, registered in its settings. Not necessarily AUDEUR.

It turns out that if I write the date and time of the bar on which the trading signal was received in a file with the name of the bot, they will interfere with each other because they will overwrite each other’s data, if the flag when opening is FILE_SHARE_READ. The question arose, how best to identify the file, so that such a thing would not happen?

It is clear that this is not a frequent case, but it still needs to be handled somehow..

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

    4 Answers

    • Voted
    • Oldest
    • Recent
    1. swan

      swan

      • 0 Questions
      • 2 Answers
      • 0 Best Answers
      • 24 Points
      View Profile
      swan
      2020-12-27T05:11:45+00:00Added an answer on December 27, 2020 at 5:11 am

      hoz:

      Here, for example, there is a bot that is running on some thread currency instrument, let’s say, AUDEUR. The second bot is also running on the same trading instrument. But each bot trades its own trading tools, registered in its settings. Not necessarily AUDEUR.

      The simplest thing is the input variables in the file name, those that will definitely be different in this case.

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

      hoz

      • 16 Questions
      • 22 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      hoz
      2020-12-27T05:11:41+00:00Added an answer on December 27, 2020 at 5:11 am

      Maxim Kuznetsov:
      Yes, as well as prevent conflicts of bots in the terminal. MAGIC.

      Not quite an option because my magic is dynamically calculated. At the stage of initialization of the program, you will have to calculate it, and this is not really an option. Although, .. such thoughts visited me too))

      Vitalii Ananev:

      And what prevents you from adding the name of the symbol to the file name and for reliability also the time interval of the chart on which your bot is located. Or even easier to add the “magic number” of the bot to the file name.

      I walked today for half a day and thought about it in parallel. While I was wandering, I decided to use the file name + name of the trading instrument + TF in the folder with the bot name. How do we know the magic bot? You can, of course, calculate, but is it worth it?

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

      vitales

      • 1 Question
      • 22 Answers
      • 0 Best Answers
      • 72 Points
      View Profile
      vitales
      2020-12-27T05:11:36+00:00Added an answer on December 27, 2020 at 5:11 am

      hoz:

       If the bot trades on different trading instruments at once, and it has periods when there are several open orders at some point in time. In a class that receives a General trading signal, depending on various factors, I want to remember the dates and times of the bar on which the trading signal was received and, accordingly, the trade was made. So this data, i.e. the date and time of the bar on which the trading signal was received, can be steamed during the execution of the program, if, for example, the program is reinitialized, depending on some factors. I decided that they should be saved after a successful transaction. If you do not do this, after reinitializing the program, I will have a transaction made on the same signal that has already been worked out. And this is not an option.

      I decided to write this data to a file. Everything is logical here. But there is one point!

      Here, for example, there is a bot that is running on some thread currency instrument, let’s say, AUDEUR. The second bot is also running on the same trading instrument. But each bot trades its own trading tools, registered in its settings. Not necessarily AUDEUR.

      It turns out that if I write the date and time of the bar on which the trading signal was received in a file with the name of the bot, they will interfere with each other because they will overwrite each other’s data, if the flag when opening is FILE_SHARE_READ. The question arose, how best to identify the file, so that such a thing would not happen?

      It is clear that this is not a frequent case, but it still needs to be handled somehow..

      And what prevents you from adding the name of the symbol to the file name and for reliability also the time interval of the chart on which your bot is located. Or even easier to add the “magic number” of the bot to the file name.

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

      nektomk

      • 2 Questions
      • 37 Answers
      • 0 Best Answers
      • 92 Points
      View Profile
      nektomk
      2020-12-27T05:11:32+00:00Added an answer on December 27, 2020 at 5:11 am

      hoz:

       If the bot trades on different trading instruments at once, and it has periods when there are several open orders at some point in time. In a class that receives a General trading signal, depending on various factors, I want to remember the dates and times of the bar on which the trading signal was received and, accordingly, the trade was made. So this data, i.e. the date and time of the bar on which the trading signal was received, can be steamed during the execution of the program, if, for example, the program is reinitialized, depending on some factors. I decided that they should be saved after a successful transaction. If you do not do this, after reinitializing the program, I will have a transaction made on the same signal that has already been worked out. And this is not an option.

      I decided to write this data to a file. Everything is logical here. But there is one point!

      Here, for example, there is a bot that is running on some thread currency instrument, let’s say, AUDEUR. The second bot is also running on the same trading instrument. But each bot trades its own trading tools, registered in its settings. Not necessarily AUDEUR.

      It turns out that if I write the date and time of the bar on which the trading signal was received in a file with the name of the bot, they will interfere with each other because they will overwrite each other’s data, if the flag when opening is FILE_SHARE_READ. The question arose, how best to identify the file, so that such a thing would not happen?

      It is clear that this is not a frequent case, but it still needs to be handled somehow..

      Yes, as well as prevent conflicts of bots in the terminal. MAGIC.

      • 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