EarnForex / PositionSizer

Calculate your position size based on the risk and account size and execute your trades with this free MetaTrader expert advisor.
https://www.earnforex.com/metatrader-expert-advisors/Position-Sizer/
Apache License 2.0
386 stars 154 forks source link

"invalid stops" and "no prices" errors #92

Open paparapapapapa opened 3 weeks ago

paparapapapapa commented 3 weeks ago

Hi, I'm experiencing the following errors from time to time and I can't figure out what's the problem.

Maybe something about SL distance and spread combination? Sometimes the error goes away by moving around the SL a bit, but today nothing changed and I was unable to open a position:

Screenshot 2024-07-12 alle 11 32 40

Thank you for this EA anyway, usually it works very well!

Edit: further info

Screenshot 2024-07-12 alle 11 38 45

EA version 3.07 on latest MT5

EarnForex commented 3 weeks ago

Hello!

Regarding the [Invalid stops] error: This error appears when either stop-loss or take-profit are too close to the current price. This happens especially often when the pair's spread widens.

Regarding the [No prices] error: This error is the same as the [off quotes]. It appears when the price you are trying to enter at is no longer available or when there is no recent price for the instrument at all. This may happen either when the price is moving very fast or when there is no liquidity at all (near market open/close time).

paparapapapapa commented 3 weeks ago
  1. How much close is too close? I'm trading my strategy with your EA since February and this is the first time that I can't enter a trade even widening the SL. And the SL distance is quite consistent in my strategy.

  2. Could this be an issue with my broker quotes? Or what else? Because the price wasn't moving fast and this happened today near 5 am EST. No peak hour, but a fair volume.

Maybe turning IgnoreMarketExecutionMode to False could be of some help?

EarnForex commented 3 weeks ago

How much close is too close? I'm trading my strategy with your EA since February and this is the first time that I can't enter a trade even widening the SL. And the SL distance is quite consistent in my strategy.

That's a variable distance. You should be seeing the "SL too close!" warning near the stop-loss level on the Main tab of the Position Sizer, when the SL is too close. However, there is a bug that sometimes prevents that message from appearing. It's best to consult your broker for the relevant stop levels (that's how that minimum distance is called) for that instrument.

Could this be an issue with my broker quotes? Or what else? Because the price wasn't moving fast and this happened today near 5 am EST. No peak hour, but a fair volume.

I have no idea. Perhaps, that's an issue with your broker. Perhaps, it's just poor market conditions (5 AM EST doesn't seem like a normal market time for WTI). Also, do you have the 'Ask for confirmation' checkbox checked on the Trading tab? Because if you do, it adds some delay between the time between pressing the Trade button and the order going to the server.

Maybe turning IgnoreMarketExecutionMode to False could be of some help?

No, this has nothing to do with the current issue you are facing.

paparapapapapa commented 3 weeks ago

Thank you for your explanations.

Also, do you have the 'Ask for confirmation' checkbox checked on the Trading tab? Because if you do, it adds some delay between the time between pressing the Trade button and the order going to the server.

Maybe this is the reason. I’ve just checked and the checkbox was unselected but today the confirmation window appeared regardless. Thanks for pointing that out. Next week I’ll test it without confirmation and report back.