title: How to get an amount of open trades in MQL5
body: <p>I want to get the amount of open trades in <strong><code>MQL5</code></strong> on a demo account during strategy testing.</p>
  
  <p><code>PositionsTotal()</code> and <code>OrdersTotal()</code> always return <strong><code>0</code></strong> even if there are open trades.</p>
  
  <p>The solution suggested <a href="https://www.mql5.com/en/forum/1995#comment_18270" rel="nofollow">here</a> does not work.</p>
  
  <p>Any help will be appreciated.</p>