it may be from the Bid/Ask calculation
if i used MQLTick there is no problem with the stops, but then i doesnt open sell trades, the Bid i think does not quite work. When i used CSymbol to determine bid/ask, sell worked but the problems with the stops started. If i use SymbolInfoDouble(_Symbol,SYMBOL_ASK) , no orders are opened. Very strange !
Hi All,
I have an issue with sending orders, due to
2018.10.22 23:53:13.079 Core 1 2017.03.15 19:00:00 failed modify #2 sell 0.03 EURUSD sl: 0.00000, tp: 0.00000 -> sl: 0.01000, tp: -0.01000 [Invalid stops]
this kind of error. I believe all stops are normalized, adapted for stoplevel and i think are ok. I also tried 2 versions - with setting the tp and sl in the ordersend, and by modifying the order later, none work.
This is my code, this all feels strange, considering the SL and TP are calculated rigth, i hope you can find something i didnt notice.
Really ? A SL of 0.01 and a negative TP doesn't seem "calculated right".
What is Ask/Bid in mql5 ?
Really ? A SL of 0.01 and a negative TP doesn't seem "calculated right".
What is Ask/Bid in mql5 ?
what i meant is that they seemed right, but considering they dont work, they apparently are not
the TP and SL i have set to 100 pips, but i have no idea how can a negative TP be ?
Sorry but i am not that good in MQL5
the TP and SL i have set to 100 pips, but i have no idea how can a negative TP be ?
Sorry but i am not that good in MQL5
Because your Ask value is 0.
Forum on trading, automated trading systems and testing trading strategies
Alain Verleyen, 2018.10.22 23:10
Really ? A SL of 0.01 and a negative TP doesn't seem "calculated right".
What is Ask/Bid in mql5 ?
Because your Ask value is 0.
ok, i tested the Bid/Ask, when i use mqltick they work, the tp,sl are ok. When i use CSymbol Ask/Bid, they return 0.
Try this:
double NormalizePrice(double price) { double m_tick_size=SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE); return(NormalizeDouble(MathRound(price/m_tick_size)*m_tick_size,_Digits)); }
it may be from the Bid/Ask calculation
if i used MQLTick there is no problem with the stops, but then i doesnt open sell trades, the Bid i think does not quite work. When i used CSymbol to determine bid/ask, sell worked but the problems with the stops started. If i use SymbolInfoDouble(_Symbol,SYMBOL_ASK) , no orders are opened. Very strange !
CPositionInfo ExtPositionInfo;
ExtSymbolInfo.Name(Symbol());
PositionSelect(_Symbol);
May help.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All,
I have an issue with sending orders, due to
2018.10.22 23:53:13.079 Core 1 2017.03.15 19:00:00 failed modify #2 sell 0.03 EURUSD sl: 0.00000, tp: 0.00000 -> sl: 0.01000, tp: -0.01000 [Invalid stops]
this kind of error. I believe all stops are normalized, adapted for stoplevel and i think are ok. I also tried 2 versions - with setting the tp and sl in the ordersend, and by modifying the order later, none work.
This is my code, this all feels strange, considering the SL and TP are calculated rigth, i hope you can find something i didnt notice.