fxDreema

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

    Switching between EAs and timeframes

    Questions & Answers
    4
    8
    2842
    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.
    • X
      Xander last edited by

      Hi All
      I have been struggling with multiple timeframes for a bit now. The components of current EA I am working on works perfectly on a 1h chart and 5min chart. The problem I have is that the EA requires X to happen on the 1h chart and should then drop down to a 5min chart and do Y. The solution I came up with was "Set current timfeframe for next blocks" block. But it does not seem to be working. The command to turn on the block and have it execute is working and I can see this working in the log. The block itself does however not work. I confirmed this by connecting a sell command to this block which does not trigger. When I connect the sell command to the block which should turn this one on it does trigger. Would really appreciate some help on this

      C 1 Reply Last reply Reply Quote 1
      • C
        CPxiom @Xander last edited by

        @xander Hello, In the conditions block, at the bottom, there is "more settings", and you can set the timeframe on which that block should operate. First condition on the H1, then if that passes, the next condition block on M5. Hope this helps.

        1 Reply Last reply Reply Quote 0
        • M
          miro1360 last edited by

          You can be inspired by this:
          https://fxdreema.com/forum/topic/4222/example-price-pullback-ea

          It is not exactly what you asked for, but you can take an inspiration from that:

          • using "flags": crossUP, crossDN (you can do that multi-timeframe)
          • eventually trying to compensate indicators/signals from multi-timeframe to only one timeframe, ... for example:
            MA5 x MA20 on the 1h TF is similiar as MA60 x MA240 on the 5min TF

          Between trading and gambling is a very small gap, be careful.

          1 Reply Last reply Reply Quote 0
          • X
            Xander last edited by

            Thanks for the response guys, but I think I may have been a bit unclear in my question. Once the conditions on the 1H chart have been reached the EA determines which timeframe to go to from there and then all "timeframe" fields should be updated on this. In theory if it was a MA crossover strategy and it passes then it should drop to timeframe X, if it fails it should go to timeframe Y, both of which can change depending on the EA. The solution for this I thought was the Set current timeframe block, but as I explained above its not working, so just trying to figure out how to do this.

            C 1 Reply Last reply Reply Quote 0
            • C
              CPxiom @Xander last edited by

              @xander Maybe the "else" connector point could help? ...

              BTW... I was also searching for a solution to go up or down to next timeframe (be it M1, M5, M15, a.s.o.) The "next" part was important, to have the ea start on whatever timeframe. Couldn't find a solution yet, It's true I didn't ask...
              From what I saw, a solution may be to declare some constants, or variables, but I'm just researching that.
              If the "else" connector doesn't help, then this could be a solution for you also, if the constants part is possible... but I don't have the experience to help on that.

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

                You want to actually cause the chart to switch to another timeframe, or just use different timeframes in the EA while the chart stays the same?

                1 Reply Last reply Reply Quote 0
                • X
                  Xander last edited by

                  If possible having the actual chart switch would be ideal, but the other option should work.

                  I have hard entered the timeframes which seems to be working, but what this means is that I need to have 5-7 copies of the code in one EA to get the job done. Was hoping there is an easier way as the EA is rather big already. Can't figure out why the "Set current timfeframe for next blocks" block does not work.

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

                    I decided to test this block and I think it works. Here is my test EA: https://fxdreema.com/shared/AN7K8OQhd
                    I selected 3 different timeframes - M1, M15 and H4, and for each of them I print some information. This Delay block is to pause the EA for a while so I can see what is printer. But it looks that I need to move the chart left-right to refresh the Comment data. I see different numbers for each timeframe.

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

                    Online Users

                    J
                    B
                    A
                    E
                    R
                    S

                    17
                    Online

                    146.7k
                    Users

                    22.4k
                    Topics

                    122.6k
                    Posts

                    Powered by NodeBB Forums | Contributors