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



- www.mql5.com
- Should i move from MQL4 to MQL5 ?
- Managed Accounts Question..
- Differences between DEMO Account and 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
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); }
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
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?
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
Hi Vladimir,
Hopefully I don't misunderstand your point:
Buy Ticket = BuyPriceMaxTic
Sell Ticket = SelPriceMinTic
Forum on trading, automated trading systems and testing trading strategies
Vladimir Karputov, 2021.01.15 13:28
Where is your code in which you define the ticket?
I don't understand what you mean, I have attached the code for tracking the ticket position
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.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use