fxDreema

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

    Passing a condition for the entire candle

    Questions & Answers
    4
    5
    968
    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
      johnle1024 last edited by

      Hi,

      Here's a question I couldn't find in the forum.

      Is there a way to pass a condition for the duration of a candle?

      Example of which is if a cross of a 5MA and 20MA happens during a candle but one of the conditions to buy is if a candle is above the 100MA.

      In this example the 5MA and 20MA (On an indicator) happens first or at the beginning of a candle (triggering the pass) but the price is below the 100 MA. The price then moves past the 100MA during the candle, however the buy does not execute because the cross has already happened.

      Is there a way for a PASS to last for the duration of the candle and all conditions below it gets calculated? Meaning the crossover event keeps passing until the end of the candle and the buy is executed when/if the candle crosses the 200 MA?

      Thanks again!!

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

        "Condition" block always gives continuous signals. This block checks some values and passes (to one of its outputs). Normally this block is somewhere in "on Tick", so it runs over and over again, on each tick. If the values doesn't change so much in the period of few ticks, the block would pass the same way once for each of these ticks. That's why "Once per bar" can be used to produce only 1 signal of all these passes. If "Once per bar" is above "Condition", then the condition would be checked at the beginning of the candle. Or, if "Once per bar" is below "Condition", then "Condition" could pass in the middle of the candle and "Once per bar" will also pass at that time - in the middle of the candle.

        J W 2 Replies Last reply Reply Quote 0
        • J
          johnle1024 @fxDreema last edited by

          @fxdreema Thanks for clarifying, got most of this working !!

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

            @fxdreema Hello, My question is does the "Once per bar" condition placed at the top of a trade logic means there would only be a single pass made during the course of the candle formation even if the period of reference is Daily and there are "conditions" in the logic for the current candle?

            Also how does using the "Max times to pass" option in the "Once per bar" condition tie into my first question?

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

              @woman yes, just a single pass. "Max times to pass" changes that amount - if 5, for example, the block will pass 5 times (on the first 5 price updates of that particular candle).

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

              Online Users

              A
              M
              K
              M
              B
              A

              18
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors