fxDreema

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

    How to set/check a time stamp or candle ID

    Questions & Answers
    3
    20
    3521
    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.
    • I
      ikarus_ last edited by

      I am struggling for a really long time on a hurdle and would be glad if anyone can help.

      following example:
      Let's say I have a certain rule, that in certain circumstances I only trade when xyz happened before.

      I have some condition blocks referring to ID 0 that need to be true, fine that is no problem.
      Then I also need to check if certain conditions were true in the past.
      The problem here is that two different strings of conditions need to be true one after another but the 2nd one should only look back to the first and not further back.
      How is it possible that the first condition produces a time stamp where the 2nd condition can refer to so that It doesn't look back further.
      I haven't found a way to solve it with the candle ID because its not possible when putting lets say ID 0, 1, 2, 3... in one block. (it would still look back further as the first condition happened.

      Many thanks for your answers.
      It's probably not well described (not easy), pls let me know if you need further clarification.

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

        @ikarus_ There is no single way to get it. You can create several variables and stor information there, but your info is a bit too general to specify. Can you please share your project to find a way to do it for your case?

        (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
        • I
          ikarus_ last edited by

          Hi @l-andorrà thanks for your fast reply. Here's the link: https://fxdreema.com/shared/xslLnhN6b

          1 Reply Last reply Reply Quote 0
          • I
            ikarus_ last edited by

            I would be glad if you could answer and present a solution @l-andorrà.
            Many thanks.

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

              @ikarus_ you need a loop, every programmer's best friend.
              And to operate this loop, you have to use variables.
              Are you familiar with variables?

              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
              • I
                ikarus_ last edited by ikarus_

                @roar yes I am familiar with variables but not that much with loops.
                How would you solve this?
                (fyi this is not my whole project, just the part I am trying to get right)

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

                  @ikarus_ all right, here is an example of two loops. The example goal is to first find some candle above tenkan-sen line in the last 30 candles, and then find some candle below moving average in the last 30 candles.

                  There is probably something weird-looking here, just ask
                  https://fxdreema.com/shared/iiAq2ApF
                  0_1600859926061_c2517f87-6c26-4c01-8ddb-8623ce0368d3-image.png
                  0_1600859935219_d6045917-388c-4979-9db0-cdb171514c31-image.png

                  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
                  • I
                    ikarus_ last edited by

                    Many many thanks! @roar. It makes sense what you did and I am sure I am able to implement it into the EA.

                    Just one thing from the moment the candle close was above the tenkan sen Line it should always close above.
                    When the price closes below SMA and then crosses up again is when the order should trigger.
                    I am not sure if your example is already fulfilling that.

                    Also the Loop conditions have to always be on Tick right?

                    roar 1 Reply Last reply Reply Quote 1
                    • roar
                      roar @ikarus_ last edited by roar

                      @ikarus_ said

                      Just one thing from the moment the candle close was above the tenkan sen Line it should always close above.

                      So the condition is "each of last 30 candles are above tenkan-sen"?
                      Then use the loop to try and find a candle that doesnt meet the condition -> now set your tracking variable to FALSE. The logic flow continues to next stage only if the variable keeps its TRUE value throughout the whole loop. Hope you get what I mean...

                      Also the Loop conditions have to always be on Tick right?

                      Not necessary.. As long as you can activate the loop (using OnTick, OnTrade, OnInit, whatever), it will surely do its thing.

                      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 1
                      • I
                        ikarus_ last edited by ikarus_

                        So grateful for your help. @roar
                        Let me know if that is what you meant? https://fxdreema.com/shared/y1i7btjD
                        I need to get a better understanding of the loop system in fxdreema: any sources you can recommend?

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

                          @ikarus_ Your example is missing all variables - you need to declare them yourself, exactly as is shown in my pictures above.

                          I don't know any great learning source, my style is to try and fail, learn that way...
                          Well, Miro has created a loop tutorial but that uses the actual, official loop block, I didnt.
                          http://fxdreema.com/forum/topic/4510/tutorial-loop-advanced-find-and-save-specific-value-from-indicator-history

                          By the way, you can reset your block IDs from "Project Options" 🙂

                          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

                          I 1 Reply Last reply Reply Quote 1
                          • I
                            ikarus_ @roar last edited by

                            @roar yes I did it as you shared. I just was not able to send a picture. the variables are stored in the real project.
                            Thanks so much. Besides of the variables is it correct now?

                            yeah, try and fail worked for me until now. 🙂

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

                              @ikarus_ yeah looks ok, but because of the missing variables, cannot see the variable modifications (in right-side of blocks) which are critical for the logic
                              0_1601017232351_606baba9-8148-4f8f-879d-f19b3ae27e4f-image.png

                              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

                              I 1 Reply Last reply Reply Quote 1
                              • I
                                ikarus_ @roar last edited by ikarus_

                                @roar https://fxdreema.com/shared/fHL9Vur3
                                just did it that you can approve.
                                I think there is a big learning curve awaiting for me about loops.
                                Oh, and is it needed to reset the block ID's? I tought they always follow the logic.0_1601020235037_2020-09-25 09_50_04-LOOPING.png

                                roar 2 Replies Last reply Reply Quote 0
                                • roar
                                  roar @ikarus_ last edited by

                                  @ikarus_ this block needs to change the variable when the loop finds a suitable candle, otherwise the algo never proceeds to the next stage
                                  0_1601031610038_e914eee8-4e57-4e43-ac22-818eec0a3c55-image.png

                                  You dont need to reset the IDs, they dont matter in this EA. I just like to keep them small myself, just a preference.

                                  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 1
                                  • roar
                                    roar @ikarus_ last edited by roar

                                    @ikarus_ said

                                    I think there is a big learning curve awaiting for me about loops.

                                    Yes I think its more "advanced" stuff - and the worst part is, this particular loop logic is my own scribble lol

                                    There is also an official loop block in the builder, it works a bit different. If youre familiar with the coding jargon, my loop here is a while loop, whereas the fxdreema loop block is a for loop.

                                    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

                                    I 1 Reply Last reply Reply Quote 1
                                    • I
                                      ikarus_ @roar last edited by ikarus_

                                      @roar maybe I need to hire a coder zhat does that for me 🙂 haha
                                      https://fxdreema.com/shared/px7iX32Wb

                                      roar 1 Reply Last reply Reply Quote 1
                                      • roar
                                        roar @ikarus_ last edited by roar

                                        @ikarus_ Sorry, I confused even myself with the true/false things here.
                                        Made a fix: the comparator in the second block is ==, not !=.
                                        0_1601032823174_25678c0e-5194-4005-ad7a-e1b8922f72ce-image.png

                                        So, the logic is

                                        • when variable is false, run the loop and try to find a candle setup which makes the variable true
                                        • when it is true, proceed to next section of the EA.

                                        Edit: Goddamn now I'm confusing my projects with each other, fixed again.

                                        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

                                        I roar 2 Replies Last reply Reply Quote 1
                                        • I
                                          ikarus_ @roar last edited by

                                          @roar hahah no stress. We are all humans

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

                                            @ikarus_ https://fxdreema.com/shared/LgnX2WX3

                                            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 1
                                            • 1 / 1
                                            • First post
                                              Last post

                                            Online Users

                                            C
                                            P
                                            E
                                            R
                                            F
                                            ح
                                            H
                                            J
                                            P

                                            15
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors