Maximum amount of open orders in one time

 

Hello guys.


I would like to know maximum amount of open orders in one time when backtasting some strategy.  And sum of lot size of those opened orders should be helpful aswell.

I managed to create calculatior of currently opened orders, but I do not know how to store the highest value and highest used lot size in one time.Can you help me with that?

Here is my buy order amount  calculator:
int CountBuyPositions(){

      int NumberOfBuyPositions=0;
      for (int i=OrdersTotal()-1;i>=0;i--){
         OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
         string CurrencyPair=OrderSymbol();
         if (_Symbol==CurrencyPair && OrderType()==OP_BUY){

         NumberOfBuyPositions=NumberOfBuyPositions+1;

         }
      }
return NumberOfBuyPositions;
}
 
In future please post in the correct section
I will move this topic to the MQL4 and Metatrader 4 section.
 

ramp:
I would like to know maximum amount of open orders in one time

And sum of lot size of those opened orders should be helpful aswell.

I do not know how to store the highest value and highest used lot size in one time.

Can you help me with that?

  1. You already posted code that does that.

  2. You should already know how to do that. Show us your attempt (using the CODE button) and state the nature of your problem.

  3. Get the value, see if it is higher than your global/static variable and store if it is. Show us your attempt (using the CODE button) and state the nature of your problem.

  4. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

Reason: