QuoteDislikedIf it doesn't enter a trade, but hits the stop, then it will keep putting in a default entry for the ordersend and emptying it out over and over right?
Just to clarify, you are concerned that you have one routine that tells you that you need an order and then when it gets to the order routine, another routine say no? Is that correct?
I knew you had a knack for this......in a way you are correct and I like the way you think. You've probably I am bit of a speed freak.....I like code that executes super quick. Fortunately calculations use so few resources that there will be virtually no impact on speed. Output tends to be a big resource hog but your CPU can do millions of calculations a second, so unless you are wasting it by doing unnessesary calculations I have no qualms about doing as much maths as is needed.
If you wanted to be ultra efficient, you could place the minimum distance check in the Check_For_Trade function, subject to each of the 2 if statements.