Skip to content

Commit

Permalink
Account/Condition: Adds condition for equity 2% high/low
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Sep 11, 2021
1 parent cf8610b commit 42c45ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Account.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -559,21 +559,25 @@ class Account {
case ACCOUNT_COND_BAL_IN_PROFIT:
return GetBalance() > start_balance;
case ACCOUNT_COND_EQUITY_01PC_HIGH:
return AccountEquity() > (AccountBalance() + AccountCredit()) / 100 * 101;
return AccountEquity() > (GetTotalBalance()) / 100 * 101;
case ACCOUNT_COND_EQUITY_01PC_LOW:
return AccountEquity() < (AccountBalance() + AccountCredit()) / 100 * 99;
return AccountEquity() < (GetTotalBalance()) / 100 * 99;
case ACCOUNT_COND_EQUITY_02PC_HIGH:
return AccountEquity() > (GetTotalBalance()) / 100 * 102;
case ACCOUNT_COND_EQUITY_02PC_LOW:
return AccountEquity() < (GetTotalBalance()) / 100 * 98;
case ACCOUNT_COND_EQUITY_05PC_HIGH:
return AccountEquity() > (AccountBalance() + AccountCredit()) / 100 * 105;
return AccountEquity() > (GetTotalBalance()) / 100 * 105;
case ACCOUNT_COND_EQUITY_05PC_LOW:
return AccountEquity() < (AccountBalance() + AccountCredit()) / 100 * 95;
return AccountEquity() < (GetTotalBalance()) / 100 * 95;
case ACCOUNT_COND_EQUITY_10PC_HIGH:
return AccountEquity() > (AccountBalance() + AccountCredit()) / 100 * 110;
return AccountEquity() > (GetTotalBalance()) / 100 * 110;
case ACCOUNT_COND_EQUITY_10PC_LOW:
return AccountEquity() < (AccountBalance() + AccountCredit()) / 100 * 90;
return AccountEquity() < (GetTotalBalance()) / 100 * 90;
case ACCOUNT_COND_EQUITY_20PC_HIGH:
return AccountEquity() > (AccountBalance() + AccountCredit()) / 100 * 120;
return AccountEquity() > (GetTotalBalance()) / 100 * 120;
case ACCOUNT_COND_EQUITY_20PC_LOW:
return AccountEquity() < (AccountBalance() + AccountCredit()) / 100 * 80;
return AccountEquity() < (GetTotalBalance()) / 100 * 80;
case ACCOUNT_COND_EQUITY_IN_LOSS:
return GetEquity() < GetTotalBalance();
case ACCOUNT_COND_EQUITY_IN_PROFIT:
Expand Down
2 changes: 2 additions & 0 deletions Condition.enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ enum ENUM_ACCOUNT_CONDITION {
ACCOUNT_COND_BAL_IN_PROFIT, // Total balance in profit
ACCOUNT_COND_EQUITY_01PC_HIGH, // Equity 1% high
ACCOUNT_COND_EQUITY_01PC_LOW, // Equity 1% low
ACCOUNT_COND_EQUITY_02PC_HIGH, // Equity 2% high
ACCOUNT_COND_EQUITY_02PC_LOW, // Equity 2% low
ACCOUNT_COND_EQUITY_05PC_HIGH, // Equity 5% high
ACCOUNT_COND_EQUITY_05PC_LOW, // Equity 5% low
ACCOUNT_COND_EQUITY_10PC_HIGH, // Equity 10% high
Expand Down

0 comments on commit 42c45ca

Please sign in to comment.