fxDreema

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

    Delay EA start to first bar closes

    Questions & Answers
    2
    5
    863
    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.
    • S
      SydneyFox last edited by

      I have some once per bar blocks that I don't want to action until the first bar after the EA is initiated has closed. i.e. I load my EA and the onced per bar should start on the first tick of the next bar that opens.

      Is this possible? Anyone able to help me on this one? Thanks

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

        This can be done with some variable, but
        why do you want this, may I ask?
        There might be a more elegant solution

        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
        • S
          SydneyFox last edited by

          I am counting how many bars close within a defined support/resistance zone. Usually when loading the EA it’s outside the zone and I then use variables to count the closes within to use as a set up for a trade.

          But if the last closed trade is in the zone on initiation I want it to count that bar. It does this but then the once per bar counts it again.

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

            One solution would be to create a variable that increases every bar by 1;
            once per bar --> barcount=barcount+1

            Now you could make condition: barcount > 1 before your ea would continue the process.

            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
            • S
              SydneyFox last edited by

              Thank you very much for your reply. I really appreciate it as there's not a lot of help on here.

              Your suggestion makes sense. I'll give it a go and see if I can get it to work.

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

              Online Users

              D
              L
              H

              6
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors