how to change account balance to account equity in a mt4 algo

 

HI 

i have an algo in which all trades are terminated when account balance is more than x or less than y
how do i change this to account equity


bool Filter_AB()

{

if(DISABLE_ALGO)

     {

      if(AccountBalance()>=ACCOUNTBALANCE1 || AccountBalance()<=ACCOUNTBALANCE2 )

     {return false; }   else {return true;}

     }  

 return true;

 } 


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
 
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
              Messages Editor

  2. Perhaps you should read the manual. AccountEquity
       How To Ask Questions The Smart Way. 2004
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

  3. Simplify your code.
              Increase Order after stoploss - MQL4 programming forum #1.3 2017.05.29