fxDreema

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

    How to open a pending order at first day of the month

    Questions & Answers
    3
    7
    1377
    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.
    • J
      jasys28 last edited by

      Hi guys,

      i have been reading and cannot find how can i open a trade at first day of the month - after the first daily candle is closed or at after 18:00 that day - not including Sunday candle.

      Let me know which direction i need to go

      Much appreciated

      Thanks

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

        @jasys28 said in How to open a pending order at first day of the month:

        May be this can do it?

        0_1555180158375_Screenshot_1.png

        fxDreema 1 Reply Last reply Reply Quote 0
        • J
          jasys28 last edited by

          thank you - it opens trades at the beginning of the month.

          how can i calculate the range of the candle for that day?

          1 Reply Last reply Reply Quote 0
          • J
            jasys28 last edited by

            thank you it work great

            1 Reply Last reply Reply Quote 0
            • fxDreema
              fxDreema @vish last edited by fxDreema

              This is my idea for detecting the real first day and last day of the month: https://fxdreema.com/shared/iB1YvWgSb
              The first pair of blocks would print yellow arrows on each candle in the first day. the second pair prints pink arrows on the last day.

              For newbies, && means AND and || means OR. The whole formula can be written in 1 row only, but I wrote it like this. The condition is asking whether the first row OR the second row is true.

              Let's take block 1 for example, the second row:

              TimeDay(TimeCurrent()) < TimeDay(TimeCurrent() - 86400)
              

              TimeCurrent() gives us the current time of the current candle. This is the server time, not the local time on the PC. This is the number of seconds since 1.1.1970.
              By the way there is also function Day() that can replace TimeDay(TimeCurrent()) .
              86400 is the number of seconds in 1 day.
              TimeDay gives us the current day. Today is 25 for example.
              TimeCurrent() - 86400 is 24 hours in the past, so TimeDay(TimeCurrent() - 86400) gives us the day of yesterday. For example 24.
              So, what I ask is whether the date today is < the date yesterday. If today is 1 and yesterday is 31 (or 30, or 29), then I detected the first day of the month.

              The first row:

              DayOfWeek() == 1 && TimeDay(TimeCurrent()) < TimeDay(TimeCurrent() - (3 * 86400))
              

              DayOfWeek() is the day of the week, where 0 would be Sunday, 1 is Monday.... and 6 is Saturday. So DayOfWeek() == 1 asks if the day is Monday.
              The problem is that Monday is not always day 1. Maybe Monday is 3rd. So I compare the Monday's day with last Friday's day.

              It's all pretty much the same in block 3, but the opposite.

              1 Reply Last reply Reply Quote 1
              • J
                jasys28 last edited by

                thank you for reply i will work on it now

                1 Reply Last reply Reply Quote 0
                • J
                  jasys28 last edited by

                  hi it works really well - thank you

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

                  Online Users

                  N
                  S
                  T
                  A

                  13
                  Online

                  146.7k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors