Forum

How to count number of pending order opened in MT5

Hello, I want to count the open pending order . But my code cannot count correctly, can anyone give me a help? Thanks int ChecklimitedOrders16( int MagicNr) { int TodayslimitedOrders = 0 ; for ( int i= 0 ; i< OrdersTotal (); i++) { string OrderSymbol = OrderGetString ( ORDER_SYMBOL );

MT4 code change to MT5 code

Hello, i have a code that use in MT4 which can alert the order send error. But how can i change to MT5? Please help, Thanks int OrderErrorReport ( int OrderID) { if (OrderID < 0 ) { Alert ( "Order rejected, please check error code: " + GetLastError ()); } else {

Why the EA cannot open order in MT5 backtest?

Hello, I code a EA put in MT5 backtest, the Journal keep saying "Order place successful" , but there is no open position. Do you know why? But i can open position in other symbol. just some symbol has this problem. How can i fix it? Thanks. Print ( "SellEntry =" + SellEntry);

How to count Today Open Order in MQL5

Hello, i want to count Today Open Order, i made a code, is always return the value 0. Can anyone get a help ? please. int CheckTodayOpenOrder( int MagicNr) { int TodaysOrders = 0 ; uint TotalNumberOfDeals= HistoryDealsTotal (); ulong Ticket; string OrderSymbol; int Magic = 0 ;

how to get the last trading day specific time bar (M1) ? MQL4 MT4 coding

if i want to know last trading day 16:45 (M1) that bar. how to do this? i made a code which can know the previous 16:45 bar (M1), but if Current time pass 16:45, let said 16:50, this code only can know the previous bar 16:45 (M1), but i want to know last trading day 16:45, even if today current time