"1) If there is 0 "RUNNING" trade, validGap will return true.
What does this mean?
Do you mean if there are currently no open trades?
variable gaptrade does not appear to have been assigned a value.
You probably need the absolute value of priceDiff, if the order open price is above the current price, priceDiff will be negative, so smaller than gapTrade*onePip.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Above is a code I think of, but it does not work as intended.
What i trying achieve is
1) If there is 0 "RUNNING" trade, validGap will return true.
2) If there is a trade "RUNNING", if "open price" of the running trades(could be more than 1 trade running) vs current price have a 30 points difference ( 30 pips ) = return true for validGap, else return false
What I trying achieve is ensure all my trades have at least 30 pips difference then its return valid. Comparing only with "Running/Open Order" and not closed order in history.
Also only check against the Symbol() that the EA is running on ( for opening trades ).
Can anyone help me with my code and see whats wrong as the calculation seems a bit off, I get stuff like -1.337 for my price diff and I think it compare with history price, valid gap always return false as of the code now.
Thanks for helping!