Your topic has been moved to the section: Expert Advisors and Automated Trading
In the future, please consider which section is most appropriate for your query.
- www.mql5.com
Your topic has been moved to the section: Expert Advisors and Automated Trading
In the future, please consider which section is most appropriate for your query.
No sorry, I did not analyse your code, but here is some information that might help...
The checks a trading robot must pass before publication in the Market
MetaQuotes, 2016.08.01 09:30
Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
Forum on trading, automated trading systems and testing trading strategies
Tick size vs Point(), can be a little tricky in Multicurrency EA
Fernando Carreiro, 2022.03.09 12:11
Tick Size and Point Size can be very different especially on stocks and other symbols besides forex.
Always use Tick Size to adjust and align your prices, not the point size. In essence, make sure that your price quotes, are properly aligned to the Tick size (see following examples).
... double tickSize = SymbolInfoDouble( _Symbol, SYMBOL_TRADE_TICK_SIZE ); ... double normalised_price = round( price / tick_size ) * tick_size; ... // Or use a function double Round2Ticksize( double price ) { double tick_size = SymbolInfoDouble( _Symbol, SYMBOL_TRADE_TICK_SIZE ); return( round( price / tick_size ) * tick_size ); };
You can't move stops (or pending prices) closer to the market than the minimum: MODE_STOPLEVEL * _Point or SymbolInfoInteger(SYMBOL_TRADE_STOPS_LEVEL).
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
On some ECN type brokers, the value might be zero (the broker doesn't know). Use a minimum of two (2) PIPs.
The checks a trading robot must pass before publication in the Market - MQL5 Articles (2016)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I get this error:
failed cancel order #10 sell stop 0.35 XAUUSD at 1310.86 sl: 1313.16 tp: 1308.56 [Invalid stops]
I assume it is because the price is too close to the order before the EA sends a request to delete the order. I use this function to delete orders, and I do check for freeze level, but I must be doing it wrong.
Also, does anyone know if order expiration can cause this error? If by the time the order expires, the market is too close to the order to expire it, would that cause the same issue? In that case, I cant think of a way to check for that..
Hope someone can help me