Help With An OCO Order EA
-
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.
-
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.
-
So, I have the updated block positions and such, but it still doesn't trade. I'm stumped. https://fxdreema.com/shared/OKRqU9zT
-
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 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