This is a serious question. I developed a trading algo with Python and neural networks. The code works great for two different mock accounts. (I spent over 30 weeks on test runs with consistent profits). However, when I switched to a live account, I found something weird - about half of my orders failed (result.retcode != mt5.TRADE_RETCODE_DONE:) when I looked into my log file.
Am I setting the deviation/slippage (at 5) too low? I think 5 pips is a lot.
Can the broker selectively disable their terminal to stop receiving orders from anyone from time to time?
I also found an order suspicious yesterday as my code would be very unlikely to do something like that. So I added a line in my code to log each and every order I send.
Please share your experience if you have any. Thanks.
Hello Haitao
If your broker is a Marketmaker, then I expect anything from this type of broker. Other, “normal” brokers don’t need that. Because they make money when you make money. So they are more concerned that everything goes well with you and everything works! Of course, all of them also have monitoring systems, so that they immediately notice unusual and disturbing incidents.
That’s what happened to me once. Since icmarkets immediately stopped my account because I had an EA running with a programming error. After activation, it flooded the broker with orders. Fortunately, this was on a demo account. However, I immediately received a message from an agent that something was wrong with my account. I therefore find such monitoring rather positive.
That’s why I think it’s more likely to be a programming error on your end. Because everything looks like an order send error. And I also think your guess is correct that the opening of your order is too close to the market price. Please pay attention to your broker’s spread + slippage, among other things. Even 5 pips can sometimes be too tight, especially when the market is volatile. I think it is, since not all orders were rejected.
Best regards
Ravenash
what pairs do you trade? 5 pips for eur usd is a lot, but for gold is not. Brokers categorize their clients to evaluate risk, if broker disturb in your trading because you are a profitable trader, and it’s regulated, it is time to message regulator body.
Thanks Ravenash. I am aware of the difference between brokers and market markers (sort of) but I don’t know which camp my broker “easymarkets” blongs to. Their website says they are regulated by Cyprus SEC…
MT5’s Python reference often shows slippage to be set at 20, which looks scary to me. Maybe I will try 10 next week.
I trade 6 pairs right now - AUD, NZD, EUR, GBP, CHF and JPY against USD.
Are you sure that it is calculating in pips rather than points?
5 pips slippage in this “wierd” times could be normal, your strategy should be tested how they will behave in that environment
That was my fault. The documentation says deviation is specified in points, not in pips. Thank you so much ProfesorPips!
And yes, easymarkets is a marketmaker. I recommend a broker with ECN accounts.
Besides the fact that these brokers are not marketmakers, an EA can also handle them more accurately.
I chose to code in Python because it is a lot easier to tap into those AI/ML libraries such as numpy, pandas, keras, etc. Don’t think EA has access to machine learnig libraries. To me, trading fx manually or without AI’s help is at a huge disadvantage nowadays.