The difference between the order ticket number on the real hedging account and demo hedging account MT5

 
There is no difference in ticket numbers on demo accounts there is a difference in ticket numbers on real accounts
Hi There,

I am tracking orders via ticket for the Hedging MT5 account.

I noticed that the ticket that I was tracking was different from the ticket on the order for real accounts.

Meanwhile for demo accounts, the ticket tracking is the same as the order ticket.

Can anyone help explain why something like this could happen? With the same software, the results may differ between real accounts and demo accounts.

Is there a second order ticket on the real account?
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Account Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Sugianto :
Hi There,

I am tracking orders via ticket for the Hedging MT5 account.

I noticed that the ticket that I was tracking was different from the ticket on the order for  real accounts .

Meanwhile for demo accounts, the ticket tracking is the same as the order ticket.

Can anyone help explain why something like this could happen? With the same software, the results may differ between real accounts and demo accounts.

Is there a second order ticket on the real account?

Show your code - I hope you are taking a position ticket, not an order.

 

make sure, that you be not confused between Deal, Order and Position Ticket Number

if you haven an Market Order, then the Order and Position Ticket number is the same, if you have an Pending order, that will be different

 
Vladimir Karputov:

Show your code - I hope you are taking a position ticket, not an order.

for(int k=total-1;k>=0;k--)
      if(m_position.SelectByIndex(k))
         if((m_position.Symbol()==Symbol()||m_position.Symbol()==SubSymbol) && m_position.Magic()==EAmagic)
                 {
                  Profit=m_position.Commission()+m_position.Swap()+m_position.Profit();
                  total_profit+=Profit;
                  op=NormalizeDouble(m_position.PriceOpen(),Digits());
                  lt=NormalizeDouble(m_position.Volume(),2);
                  tk=(int)m_position.Ticket();
                  pp=NormalizeDouble(m_position.Commission()+m_position.Swap()+m_position.Profit(),2);
                  if(m_position.PositionType()==POSITION_TYPE_BUY)
                    {
                     b++;
                     Profitb=m_position.Commission()+m_position.Swap()+m_position.Profit();
                     if(Profitb>0)BuyProfit+=Profitb;
                     SumLotBuy    += NormalizeDouble(m_position.Volume(),2);                                                   
                     LotBuy        = NormalizeDouble(m_position.Volume(),2);                                                   
                     PriceBuy      = NormalizeDouble(m_position.PriceOpen(),Digits());                                              
                     ProfitBuy    += NormalizeDouble(m_position.Commission()+m_position.Swap()+m_position.Profit(), 2); 
                     if(op>BuyPriceMax || BuyPriceMax==0)
                       {
                        BuyPriceMax    = op;
                        BuyPriceMaxLot = lt;
                        BuyPriceMaxTic = tk;
                        BuyTicProfit   = pp;
                       }
                     if(op<BuyPriceMin || BuyPriceMin==0)
                       {
                        BuyPriceMin    = op;
                        BuyPriceMinLot = lt;
                        BuyPriceMinTic = tk;                        
                       }
                       BuyPriceAll+=op*lt;
                       BuySumLot+=lt;
                    }
                  // ===
                  if(m_position.PositionType()==POSITION_TYPE_SELL)
                    {
                     s++;
                     Profits=m_position.Commission()+m_position.Swap()+m_position.Profit();
                     if(Profits>0)SellProfit+=Profits;
                     SumLotSell   += NormalizeDouble(m_position.Volume(),2);
                     LotSell      = NormalizeDouble(m_position.Volume(),2);
                     PriceSell    = NormalizeDouble(m_position.PriceOpen(),Digits());
                     ProfitSell   += NormalizeDouble(m_position.Commission()+m_position.Swap()+m_position.Profit(), 2); 
                     if(op>SelPriceMax || SelPriceMax==0)
                       {
                        SelPriceMax    = op;
                        SelPriceMaxLot = lt;
                        SelPriceMaxTic = tk;                        
                       }
                     if(op<SelPriceMin || SelPriceMin==0)
                       {
                        SelPriceMin    = op;
                        SelPriceMinLot = lt;
                        SelPriceMinTic = tk;
                        SellTicProfit  = pp;
                       }
                       SelPriceAll+=op*lt;
                       SelSumLot+=lt;
                    }
               
               TotalOrders  = b + s;
               SumProfit    = NormalizeDouble(ProfitSell + ProfitBuy,2);            
               Drawdown     = NormalizeDouble(MathMax((AccountInfoDouble(ACCOUNT_BALANCE)+AccountInfoDouble(ACCOUNT_CREDIT)-AccountInfoDouble(ACCOUNT_EQUITY))/(AccountInfoDouble(ACCOUNT_BALANCE)+AccountInfoDouble(ACCOUNT_CREDIT))*100,0),2);
              
         }
 

Real Akun


With the same code, but the results of tracking ticket orders are very different between demo and real accounts.


Please point out the error

 
amando:

make sure, that you be not confused between Deal, Order and Position Ticket Number

if you haven an Market Order, then the Order and Position Ticket number is the same, if you have an Pending order, that will be different

Hi Amando,


Thank you for reminding.

I am tracking the position, the code is attached. thank's

 
Sugianto :


With the same code, but the results of tracking ticket orders are very different between demo and real accounts.


Please point out the error

Where is your code in which you define the ticket?

 
Vladimir Karputov:

Where is your code in which you define the ticket?

Hi Vladimir,


Hopefully I don't misunderstand your point:

Buy Ticket = BuyPriceMaxTic

Sell ​​Ticket = SelPriceMinTic

 
Sugianto:

Hi Vladimir,


Hopefully I don't misunderstand your point:

Buy Ticket = BuyPriceMaxTic

Sell ​​Ticket = SelPriceMinTic

 
Vladimir Karputov:

I don't understand what you mean, I have attached the code for tracking the ticket position

 
Sugianto :

I don't understand what you mean, I have attached the code for tracking the ticket position

Where? I have not seen your MQL5 code.

Reason: