fxDreema

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

    SIMPLE CROSS CONDITION NOT EXECUTED

    Questions & Answers
    2
    6
    257
    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.
    • P
      Pinoa last edited by Pinoa

      Hi folks,
      during my testing I've seen that sometimes an ea with a cross condition does not enter.
      Imagine a simple ea on M1 like:

      no trade->
      condition block (ask price crosses above sma 20)->
      once per bar->
      buy now.

      99% the Ea sees the tick where price crosses the ma but in 1% of case, if there is a peak in volatility, even if the price crosses the moving average the trade is not executed. Maybe because the Ea does not see the cross (maybe because there is not the singular tick where the condition is valid).
      Have you ever faced and solved that situation? And how?
      Thanks in advance!

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

        Ticks are price change, so if a candle moves it is because of a tick or a few. I can't say I have noticed this, maybe broker not updating the chart quickly enough, so the price move is more of a jump.

        Learn fxDreema Without the Wait!

        My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

        The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

        Don’t miss out

        Click here➡️ https://mybook.to/fxDreema to get your copy today!

        Enjoy! 😊

        P 1 Reply Last reply Reply Quote 0
        • P
          Pinoa @jstap last edited by Pinoa

          @jstap Yeah, exactly like that, "a jump". It was a luck I was on demo because not seeing a simple cross condition could be a huge problem. I was wondering if I can "solve" it in some way maybe creating a zone of 5 points like:

          condition (ask >= price x) and after condition (ask <= price x+5)

          but if the onceparbar block does not work properly it will probably open 2 positions...
          Also using "condition ask[1] crosses above ma [1]" is viable but it will make the ea twice his weight and of course if it closed a position just the candle before probably the setup Is already done and so opening another one could not be the case.

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

            Once per bar works only once per, but there are reasons why it would work more than once (although not on backtest), you could save the candle time to a global variable, and check this before acting on a setup

            Learn fxDreema Without the Wait!

            My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

            The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

            Don’t miss out

            Click here➡️ https://mybook.to/fxDreema to get your copy today!

            Enjoy! 😊

            P 1 Reply Last reply Reply Quote 0
            • P
              Pinoa @jstap last edited by

              @jstap mmmh... thanks! I'll give it a try. You are talking about something like this: https://fxdreema.com/shared/fBccUkcA

              I assumed that onceparbar with "Max time to pass" set to 1 meant that all blocks below could pass only once but I saw that in some instances it passes two times. Do you think this is because of milliseconds and so it's solved filtering the time in a variable?

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

                In that modify should only work once per bar, but the buy tree will work as many times as needed

                Learn fxDreema Without the Wait!

                My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                Don’t miss out

                Click here➡️ https://mybook.to/fxDreema to get your copy today!

                Enjoy! 😊

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

                Online Users

                A
                E
                J
                L

                10
                Online

                146.8k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors