1.***
2. Formula of normalization: ( [data folder]\MQL5\Include\Trade\SymbolInfo.mqh )
//+------------------------------------------------------------------+ //| Normalize price | //+------------------------------------------------------------------+ double CSymbolInfo::NormalizePrice(const double price) const { if(m_tick_size!=0) return(NormalizeDouble(MathRound(price/m_tick_size)*m_tick_size,m_digits)); //--- return(NormalizeDouble(price,m_digits)); }
if(trade.BuyStop(getLot(), NormalizePrice(SymbolInfoDouble(_Symbol, SYMBOL_ASK)),
You can not place a Stop at the market.
Vladimir Karputov:
1. BUY opens at the Bid price
2. Formula of normalization: ( [data folder]\MQL5\Include\Trade\SymbolInfo.mqh )
Huh ? BUY opens at Ask price, not Bid.
Alain Verleyen :
Huh ? BUY opens at Ask price, not Bid.
Oh. I got it wrong. Now I will delete the first question.
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
Hello, I'm working on an ea that executes buyStops and sellStops at specific signals already defined. The code works well in in the demo account of the metaQuotes. Switching to the broker account (The broker is Credit Financial Invest CFI and the symbol is EURUSD ) no trades are executed as I get the 10015 error code (Invalid Price). I tried a real account and a demo account from this broker and it fails with the same error.
This is the buy function: