fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    EA control from CSV

    Questions & Answers
    4
    8
    210
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      nikolay_s last edited by

      I try to control EA with CSV files in MQL/Files/settings.csv

      The file contains only one value 0 or 1. If the value is 1 = sell trades enabled, 0 = sell trades disabled.

      Now it is in a research mode that's why the csv filed is read each tick.

      How to set the 'custom MQL code'? I did something with GPT but not works. My variable is: 'sell_yn_var'

      This an example project - https://fxdreema.com/shared/Q8uwhrIY

      Thank you

      1 Reply Last reply Reply Quote 0
      • KLG
        KLG last edited by

        if you want to use AI for MQL4/5 coding i advice you to use Claude AI

        1 Reply Last reply Reply Quote 0
        • N
          nikolay_s last edited by

          Coding is not my best. Even with Claude the result will be the same. For my problem there are several solutions but the question is how to implement it in Fxdreema?

          1 Reply Last reply Reply Quote 0
          • jstap
            jstap last edited by

            the code you have looks like it would almost work, does the number change in your comment when you change in the CSV?

            Learn fxDreema Without the Wait!

            My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

            The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

            Don’t miss out

            Click here➡️ https://mybook.to/fxDreema to get your copy today!

            Enjoy! 😊

            1 Reply Last reply Reply Quote 0
            • N
              nikolay_s last edited by

              In the comment Yes, but does not affect the IF statement

              1 Reply Last reply Reply Quote 0
              • jstap
                jstap last edited by

                That kind of makes no real sense, the comment shows the variable value, your condition checks the variable, which you visibly check, then passes to the check block onto the sell block. So everything should work as expected. The best thing to do now is enact a process of elimination, link out blocks until while backtesting you find the block that is causing the trouble. Sometimes (but rarely) you have to recreate the EA from scratch.

                Learn fxDreema Without the Wait!

                My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                Don’t miss out

                Click here➡️ https://mybook.to/fxDreema to get your copy today!

                Enjoy! 😊

                1 Reply Last reply Reply Quote 0
                • N
                  nikolay_s last edited by

                  I have experience in Fxdreema since 2016 and it is the one of the times I fell.... The flow is so simple... nothing to remove.
                  Maybe somebody could exchange some other ideas.

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    sktsec @nikolay_s last edited by sktsec

                    @nikolay_s
                    The code seems straightforward and should work. I have tried it with codes similar to you. Try this one: https://fxdreema.com/shared/K9SXQIxK

                    If in your case still not working, it might be the csv file problem. The csv file in above demo is created with path fxDreema\positionAllowed.csv in the File folder. I have tested with or without delimiter, space, line feed, ... and they are all working. By the way, how do you edit and save the file ? Have you debug and check file_handle has been valid ?

                    My code is simple:

                    string InpFileName="positionAllowed.csv" ;
                    string InpDirectoryName="fxDreema" ;
                    //--- reset the error value
                    ResetLastError();
                    //--- open the file for reading (if the file does not exist, the error will occur)
                    int file_handle=FileOpen(InpDirectoryName+"//"+InpFileName,FILE_READ|FILE_CSV|FILE_ANSI);
                    if(file_handle!=INVALID_HANDLE)
                    {
                    v::positionRead = (int)FileReadNumber(file_handle);
                    //--- close the file
                    FileClose(file_handle);
                    }
                    capture_001_31012026_002040.png

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post

                    Online Users

                    A
                    S
                    M
                    A
                    L
                    G
                    N
                    S

                    29
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors