Forum

How to get the ticket of position opened bt m_trade.buy?

Hi, I'm trying to migrate an expert from mql4 to mql5, but I can't get the ticket of the new position that just opened. In mql4, OrderSend() will return the ticket automiticly, but in mql5, trade.mqh m_trade.Buy only return true or false. Please help me about how to get the ticket of position that

Why EA's backtest and live have different result?

This is the backtest result, open 4 trades. This is my live account, only 1 trade opened, and the trade should closed two bars ahead according to EA's rules, but it didn't. Could somebody tell me why this happened? Thank you

Can't double a 0.1*3 value, but 1*0.3 is fine

Please help me with this problem, don't know why i can't double a value by this double a= 0.1 * 3 ; But if i use this it will work well double a= 1 * 0.3 ; Even i change the code to this double a= 0.1 + 0.1 + 0.1 ; it still doesn't work well. Never have this problem before, don't know why, anyone

Could someone explain why this indicator isn't loading correctly by iCustom?

Hi, I want to creat a EA recently, it use a indicator below, but i can't load it correctly by iCustom, could someone tell me where is the mistake? Thank you Here is how i call the indicator: double SRSI; SRSI=iCustom(NULL,0,"StochRSI-V8",4800,"false",0,1);