Description

The plugin serves to avoid situations where the client is speculating on the accumulated trade credit funds with a negative balance. The plugin allows you to adjust the ratio of debt on the balance sheet and available credit to zero balance account. If trading account exceeds the limit on the size of the loss of the client orders can be closed automatically (depending on the configuration of the plugin) and the negative balance will be reseted to zero. Also credit operations will be written off that fall under the rule of write-offs configured in the plugin settings.

The terminal mail will be sent to the customer with notification about zeroing his trading account after the operation of resetting the balance. Message format can be set in the template file of the terminal letters.

The plugin allows to specify comments of zeroing balance and credit.

Trading account will be zeroed in cases below:

ACCOUNT_BALANCE < -(CREDITED_BONUS * MaxDebtPercent / 100.0)

or

ACCOUNT_EQUITY < -(CREDITED_BONUS * MaxDebtPercent / 100.0)

Settings:

CheckEquity – the flag of activation checking of account's equity. If 1, account will be zeroed in case of negative balance and equity (if ZeroingMode (UAL) setting's value = U) and only equity will be checked in closing order trigger (if ZeroingMode (UAL) setting's value = A). If 0, plugin will be checking only account's balance (exception: if ZeroingMode (UAL)=L, in this mode only equity will be checked).

Data type:

numeric

Default value:

0

Value example:

1

ClientStatus – the filter of account status to which perform a zeroing. If ZeroingMode (UAL)=U, ZeroingMode (UAL)=UA or ZeroingMode (UAL)=UAL, then the event of account status update to the one specified in this setting, the account balance will be reseted to zero. At the same time opened transactions will not be closed.

Data type:

string

Default value:

upd0

Value example:

upd_status

Comment_AutoCloseOrder – commentary of automatically closed open orders after zeroing.

Data type:

string

Default value:

automated close (negative balance)

Value example:

auto close order

Comment_BonusOut – the comment of zeroing trading account credit.

Data type:

string

Default value:

bonus out (negative balance)

Value example:

zeroing credit

Comment_ZeroBalance – the comment of zeroing trading account balance. The plugin checks the trading account history from the first to the last transaction, or until it reaches the balance operation with the comment in the setting.

Data type:

string

Default value:

Zero Balance Correction

Value example:

zeroing balance

CreditControlDays – the number of days during which to be considered available credit. If CreditControlDays = 365, then the cradit transactions will be selected for the last 365 days that will be calculated in the value of BONUS_CREDIT. If 0, the opening of orders will not be allowed for any negative balance regardless of the existing credit funds.

Data type:

numeric

Default value:

90

Value example:

365

Filter_Color – the filter by account's color which will be processed by plugin. If empty then this setting will not be used for filtering by account color. According to other settings, accounts with specified colors will be processed. The color should be set in HEX format like RRGGBB.

Data type:

string

Default value:

(empty value)

Example value:

,FF0000,A3A3A3,0000FF,

Filter_CreditIn – the filter of credit operations by the comment, involved in calculating the available credit funds. Calculating the amount of BONUS_CREDIT will include the bonus credit operations with comments according to this setting as their sum.

Data type:

string

Default value:

never reduce

Value example:

,bonus in*,

Filter_CreditOut – the filter of credit operations by the comment, involved in calculating the available credit funds. Calculating the amount of BONUS_CREDIT will include the bonus credit operations with comments according to this setting as their sum.

Data type:

string

Default value:

withdraw bonus

Value example:

,bonus out*,

Filter_Group – the filter of trading groups which will be processed by plugin. If the trading account is in the group specified in this setting, the plugin will process it, otherwise - will skip.

Data type:

string

Default value:

*

Value example:

,GROUP-AB,PIPS-USD*,

Filter_Login – the filter of trading accounts which will be processed by plugin (if it's needed to filter several accounts then settings should be configured like this: Filter_Login, Filter_Login1, Filter_Login2, ..., Filter_LoginN).

Data type:

string

Default value:

Value example:

12345 (account's number)

FilterSkip_Color – the filter by account's color which will be skipped from processing by plugin. If empty then this setting will not be used for filtering by account color. According to other settings, accounts with specified colors will be skipped from processing. The color should be set in HEX format like RRGGBB.

Data type:

string

Default value:

(empty value)

Example value:

,FF0000,A3A3A3,0000FF,

FilterSkip_Login – the filter of trading accounts which will be skipped by plugin (if it's needed to exclude several accounts then settings should be configured like this: FilterSkip_Login, FilterSkip_Login1, FilterSkip_Login2, ..., FilterSkip_LoginN).

Data type:

string

Default value:

Value example:

12345 (account's number)

ForcedZeroingFlag – zeroing by closing the order even if opened orders exist, which will be closed in this case. If 1, the account debtor during zeroing by "on the closure orders" mode, all open orders will be automatically closed. If 0, the open orders for zeroing will not be closed.

Data type:

numeric

Default value:

0

Value example:

1

Mail_SenderAddress – address of mail sender.

Data type:

string

Default value:

Automatic message (Do not reply)

Value example:

Zeroing Account Message

Mail_SenderLogin – login of mail sender. If 0, the terminal mail will not be sent to the trading account after zeroing.

Data type:

numeric

Default value:

0

Value example:

111 (sent manager's login)

Mail_Subject – mail subject.

Data type:

string

Default value:

Account Balance

Value example:

Balance Notification

Mail_Template – the path to the template letter to be sent automatically if the ratio of the difference between the balance and profit of closed order to an available credit exceeds value of MaxDebtPercent. A Terminal mail template should be in the templates folder of the trading server. If left empty, the terminal mail will not be sent to the trading account after zeroing.

Data type:

string

Default value:

Value example:

BZ_ZeroingMail.tpl

MaxDebtPercent – percentage of the maximum ratio of balance debt to available credit due which trading account will not be zeroed automatically. It is used in checking of accounts bankruptcy on the condition:ACCOUNT_BALANCE <= - (BONUS_CREDIT * MaxDebtPercent / 100.0)

Data type:

numeric

Default value:

85.0

Value example:

50.0

TreatCreditAsBonus – activation mode of interpretation of the current credit account as a bonus. Thus, the debt will be calculated from the current credit of the account. If 0, then for the calculation of BONUS_CREDIT will be used the credit transactions that satisfy the conditions and Filter_CreditIn and Filter_CreditOut settings. So usually BONUS_CREDIT be <= current account credit funds. If 1, BONUS_CREDIT is equal to the current credit funds of a trading account.

Data type:

numeric

Default value:

0

Value example:

1

ZeroingMode (UAL) – the mode of zeroing (U – by account status; A – by close order; L – realtime checking of account's equity) - this is the event after which plugin starts processing of an account.