fxDreema

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

    _Time Function doesnt correctly calculate Components time

    Bug Reports
    4
    6
    1045
    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.
    • A
      adakco last edited by

      Hi Not Work Link https://fxdreema.com/shared/p8XrtPeYd

      l'andorrà 1 Reply Last reply Reply Quote 0
      • K
        kroghd last edited by

        Hi,

        There seems to be a problem with the result being returned by _time function under time mode 'Components'.

        I have implemented a block as a formula modification for my example because I'm trying to add 30 minutes onto a orders open time unix timestamp but the result wasn't right.

        To isolate I set the left value to zero to see what the result coming from _time was.

        If you setup like the picture you will see the function does not seem to be supplying the expected value of time beginning from 1st of Jan 1970 but seems like it is calculating from today as its starting value.

        If you could please check this on your side.

        Thanks

        -David
        fxd_time_calc.png

        ......
        fxd_time_calc.png

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

          This does not return the value of 30 (minutes) *60 (seconds), which is 1800. This returns Unix timestamp, as it is here: http://www.epochconverter.com/
          Here is some example where you can see the exact value: https://fxdreema.com/shared/p8XrtPeYd

          If you want to add 30 minutes to some time, 30*60 will work. And if you get the time from Condition->Time and you want to add minutes to this time, look at the "Shift in Time" option below.

          By the way I found problem with Components part in Condition->Time and I fixed it. I was using some cache before (using static variables) to make it faster, but now I realized that I was missing something and when the day changes the value does not change... so I removed that cache.

          1 Reply Last reply Reply Quote 0
          • K
            kroghd last edited by

            Thanks - for the clarification - for some reason I thought that returning 30 minutes from unix time from 1970 & adding it to unix time for now would be the same as adding 30 minutes to now.

            One feature that would be handy from your suggestion - is to have support for Time Mode - Full DT Stamp (Unix) - as the current Time Stamp suggests its only for HH:MM? - With this feature I could set a variable value that is time shifted forward from trade open unix timestamp without needing to use custom MQL.

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

              It's not only HH:MM, the function StrToTime is used, which allows different variants: http://docs.mql4.com/convert/strtotime
              But I don't think you need other variants, because they are too specific with their day, month and year, while HH:MM is for the current day. This HH:MM is not the number of seconds, it does not return 1800 when it is 00:30. What it returns is the unix timestamp at 00:30 for the current day.
              Adding some time is normally done by adding seconds, for example in the "Adjust" field, something like "+1800" (if the value above is time value of course). There is no "Adjust" for Value-Time, but there is this "Shift in Time", which is basically the same.

              1 Reply Last reply Reply Quote 0
              • l'andorrà
                l'andorrà @adakco last edited by

                @adakco No project is visible.

                (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

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

                Online Users

                H
                T
                S
                A
                S
                I
                H
                M

                13
                Online

                146.7k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors