fxDreema

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

    Filter for SPECIFIC days of the month?

    Questions & Answers
    2
    4
    244
    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.
    • G
      GTOAT777 last edited by

      I know you can use the weekday filter for specific days of the week but is there an option to chose specific days of the month, so I can customise it for the month and leave it, for example only trade on the 11th, 16th, 23rd and 25th.

      roar 1 Reply Last reply Reply Quote 0
      • roar
        roar @GTOAT777 last edited by

        @GTOAT777 well TimeCurrent() will get you something like 2015.01.01 00:00 - then you can transform it into a string with TimeToString() and then you can take a StringSubstr() to get only the date.

        Maybe there is a simplier option too, but this should work.

        Need small help? Tag me in your post
        Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

        G 1 Reply Last reply Reply Quote 0
        • G
          GTOAT777 @roar last edited by

          @roar Thanks for you advice but I’m not sure what the () means

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

            It signifies a function. Sometimes you need to put stuff inside the parenthesis, sometimes not, depending on function. But functions always need them to identify as functions instead of variables.

            I will write a more detailed example in a custom mql code block, but you will have to troubleshoot it from there (using the Print() function for example)

            datetime time = TimeCurrent();
            string timestring = TimeToString(time);
            int day = (int) StringSubstr(timestring, 8, 10);
            Print(day);
            Print("Today is " + day + "th day of the month");
            

            Need small help? Tag me in your post
            Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

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

            Online Users

            L
            K
            H
            N
            J

            17
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors