fxDreema

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

    Help With An OCO Order EA

    Questions & Answers
    5
    25
    1569
    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.
    • jstap
      jstap last edited by jstap

      It depends, take a standard condition, if candle ID1 high should be above MA50, and you check this at the open of a 4H candle, but it's not, then 5 minutes latter it is above, but your EA wants to wait 3hours 55minutes before checking again, so you would have been better to wait for the condition to be true before activating the once per bar block.

      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
      • R
        RGoo last edited by

        It is not so easy to explain why we overvalue an action after the "close" price of a candle. But I want to try to make a simple thought. The closing price only says that at the time when the time for this candle was over it had this value. Not more! So if buyers of a position had bought a little later, the closing price would be different. If the candle didn't last 5 minutes, but 5 minutes and 30 seconds, the price would be different. The highest and lowest prices in a unit of time are much more important. The only influence is that some traders pay attention to opening and closing prices and of course influence them.

        RGoo

        1 Reply Last reply Reply Quote 0
        • A
          AlexisC25 last edited by

          So, I have the updated block positions and such, but it still doesn't trade. I'm stumped. https://fxdreema.com/shared/OKRqU9zT

          1 Reply Last reply Reply Quote 0
          • R
            RGoo last edited by

            If I haven't written the code myself, it's always difficult to judge it, so if I write that in my opinion one thing or another is wrong, don't take it too seriously, I could be wrong. OK, but I think there are some errors in your code or things that shouldn't be done that way. 1. for "Check trades count" with your input, use "if trade" , the block "pass" is unnecessary at this point. Read the instructions for fxdreema carefully, everything important is in there. Now to the most important thing: are you sure that your indicator outputs a color value? I can't imagine that, but I can't help you with that either because I don't use MT4. The "delay" block is also unnecessary, what do you want to do with it? You use it when you can better observe a process in the strategy tester or for very specific things in the code, but not without an important reason.

            RGoo

            A 1 Reply Last reply Reply Quote 0
            • A
              AlexisC25 @RGoo last edited by

              @RGoo I'm definitely not offended! You were constructive and I'm still very much learning. And you're right! I've played around with it more and honestly I don't really need the if trade either. If it comes out true it will pass through the and logic and if false it will either not move, or the else logic will be triggered from what I've seen. Also, the delay was because it was on a USA regulated broker and they're SO stupid with FiFo rules. I was honestly just trying to give my broker enough time to process the close of the previous trade before it placed another trade so I didn't have to use a loop process to make sure each trade is closed in order in the event that one is still open when another is open and the close hasn't fully triggered yet. That has been the only way I can make anything FiFo compliant and am honestly ready so stay off of US regulated broker because of it lol

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

              Online Users

              V
              A
              P
              A
              A
              X
              K
              F

              26
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors