fxDreema

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

    activate a condition for four 4H candles only

    Questions & Answers
    3
    6
    1341
    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
      Jtex555 last edited by

      Hello Traders

      I've been searching here for anyone had same question didn't find any so,

      Lets say Stoch main line and signal line crossed up, that will activate a condition that would happen(on) for the next four 4H candles only if the condition didn't meet than back to normal again.

      I would appreciate your help Thanx and happy weekend ahead.

      drayzen 1 Reply Last reply Reply Quote 0
      • J
        Jtex555 last edited by

        Any suggestions ??

        1 Reply Last reply Reply Quote 0
        • drayzen
          drayzen @Jtex555 last edited by drayzen

          Hi @jtex555 ,
          Sorry, I'm not sure if you're meaning the Stoch lines cross one another, or both cross something else.

          • If crossing one another you only need x1 of the first Condition blocks where you specify Signal x>/x< Main then in the More Settings section specify the Timeframe for each side, or only one if you prefer...
            You might like to link your Timeframe settings as Constants or Variables for testing other timeframes.
            Though the variable inputs in MT4/5 are a little cumbersome (https://fxdreema.com/forum/topic/5289/timeframe-as-input)
          • If you're checking if both Main and Signal have crossed something else, then you'll need to use x2 Condition blocks, one for each.
            For all blocks, the yellow output is the FALSE condition you mention if you need to direct processing flow somewhere.
            Note that you'd only use the yellow outputs if you actually have something you want to do if your conditions aren't met.

          ..the alien does not concern itself with the opinions of humans..

          J 1 Reply Last reply Reply Quote 0
          • J
            Jtex555 @drayzen last edited by

            @drayzen Thanx for your respons

            Maybe my question wasn’t clear, the main idea is not about the timeframe or crosses of stoch, the question is about activing (switch it to On) a Condition up to 4 candles only in any timeframe than switch it off if it didn’t meet my other condition command . Hope it’s more clear
            Thanx again

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

              You need to learn variables, and use 2 of them:
              one variable as a trigger (for example, "trigvar=1" when activated and "trigvar=0" when deactivated)
              and other variable to keep track of time (on every bar, "barcount=barcount+1")
              To stop your process: if "trigvar=1" then check if "barcount > 4" -> if true, "trigvar=0"

              It probably looks difficult, but I trust you will find how to do it 😄

              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
              • drayzen
                drayzen @Jtex555 last edited by drayzen

                Hi @jtex555 ,
                I actually just used the Indicator falls within limits block for the first time and it sounds like what you're after.
                https://fxdreema.com/shared/SwJ2mrNPc
                In this example the Condition block is for C0 and the Indicator falls within limits is for C1+n.
                You can even specify a number of candles in the range that can be out of your limits.

                ..the alien does not concern itself with the opinions of humans..

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

                Online Users

                K
                A
                D
                S

                13
                Online

                146.7k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors