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 5490
Next
In Process
fresto
fresto

fresto

  • 18 Questions
  • 18 Answers
  • 0 Best Answers
  • 24 Points
View Profile
  • 0
fresto
Asked: December 29, 20202020-12-29T09:50:04+00:00 2020-12-29T09:50:04+00:00In: Forex Expert Advisors

How to open an Excel csv file

  • 0

You need to open an Excel file in csv format and get data from it. I found similar questions on the forum, but I couldn’t open them. 
int filehandle=FileOpen("1.txt",FILE_CSV|FILE_READ,";");
if(filehandle!=INVALID_HANDLE)
Alert("File is open");

The code is simple. And why is the file always deleted from the folder in the tester after various debugs? The file contains data via “;”

  • 2 2 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. barabashkakvn

      barabashkakvn

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

      Fresto:

      Yes, I have already dealt with this issue. I couldn’t get the folder wrong. There is a script that opens the file for writing and if there is no file, creates it in the same folder. And all the same, I threw it in the Files folder, where the terminal is, and in the Files folder where the tester is. 
      Approximate course of action :

      The file is in the folder. 

      The data file

      The code of the EA

      The result is -1 = Error opening file

      The file in the folder is deleted after debugging

      The code from the first post is working. It’s all about HOW you run your code and WHERE the file lies “Si.txt”.

      In general, place your file in a shared folder, and use the FILE_COMMON flag to open it.

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

      fresto

      • 18 Questions
      • 18 Answers
      • 0 Best Answers
      • 24 Points
      View Profile
      fresto
      2020-12-29T09:50:10+00:00Added an answer on December 29, 2020 at 9:50 am
      How to open an Excel csv file

      Vladimir Karputov:

      Reference:

      All test agents are isolated from each other and from the client terminal: each agent has its own folder where agent logs are recorded. In addition, all file operations during agent testing occur in the agent_name/MQL5/Files folder. However, you can implement interaction between local agents and the client terminal through the shared folder of all client terminals, if you specify the FILE_COMMON flag when opening the file

      Thus, if you run debugging on history (“Ctrl” + “F5”) or run the strategy tester (from the terminal), then you need to put your test file in the folder agent_name/MQL5/Files.

      Yes, I have already dealt with this issue. I couldn’t get the folder wrong. There is a script that opens the file for writing and if there is no file, creates it in the same folder. And all the same, I threw it in the Files folder, where the terminal is, and in the Files folder where the tester is. 
      Approximate course of action :

      The file is in the folder. 

      The data file

      The code of the EA

      The result is -1 = Error opening file

      The file in the folder is deleted after debugging

      • 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