Account Equity / Available Margin / Account balance? - page 3

 
Algo: I don't understand where I'm wrong.
  1.                     CurrentAccountBalance[i] = AccountBalance();
    
                        PreviousAccountBalance = CurrentAccountBalance[i-1];
    AB is the current balance, all you've done is set all elements to the same exact value. (And I ignore the hard coded array size.)

  2. You assume that only closed orders are in history.

  3. Using OrdersTotal OrdersHistoryTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
              Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 programming forum
              MagicNumber: "Magic" Identifier of the Order - MQL4 Articles

  4. Do not assume history is ordered by date, it's not.
              Could EA Really Live By Order_History Alone? (ubzen) - MQL4 programming forum
              Count how many lost orders from the last profit order - MQL4 programming forum

Reason: