Skip to main content
Version: 2.0

AISP - All Inspector

The Custom Expert Advisor employs an inspector engine, continuously calculating the current performance and drawdown in real-time. As you may already know, each trading module has the same inspector feature. The key difference with the All Inspector is that this algorithm aggregates the results of each activated trading module to monitor the overall performance and drawdown.

This means that if a defined drawdown or performance limit is reached, all included trading modules will be disabled, even if the individual inspectors of a module have not reached their individual limits. Apart from the observed range, the functionality of the All Inspector module is identical to that of the standard inspector. Therefore, in this section, the term Inspector is synonymous with All Inspector.

Enabling and disabling of notifications

The live variant of the Custom Expert Advisor can provide updates on reached inspector limits and various reports on its latest performance and drawdown metrics. These messages can be displayed via the MetaTrader's expert tab or sent as emails through the built-in MetaTrader emails API. If you wish to modify the messages you'll get, you can adjust the following input parameters.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Notification protection
(IN_enmAispNotificationProtection)
ONNumeric values usable in SET files:
0 - OFF
1 - ON
> (AISP) Notification report daily
(IN_enmAispNotificationReportDaily)
ONNumeric values usable in SET files:
0 - OFF
1 - ON
> (AISP) Notification report weekly
(IN_enmAispNotificationReportWeekly)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (AISP) Notification report monthly
(IN_enmAispNotificationReportMonthly)
ONNumeric values usable in SET files:
0 - OFF
1 - ON
> (AISP) Notification report end
(IN_enmAispNotificationReportEnd)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON

Notifications types and MetaTrader configuration

The input parameters discussed so far determine the information sent to you. In contrast, the following parameters define how this information will be delivered.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Notification logs
(IN_enmAispNotificationLogs)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (AISP) Notification mails
(IN_enmAispNotificationMails)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON

The Custom Expert Advisor can relay information via the experts tab in your MetaTrader terminal view and through email. The first option, which can be enabled with the input parameters > (AISP) Notification logs, is functional with both the tester and live variants of the Custom Expert Advisor. The second option (> (AISP) Notification mails) allows the Custom Expert Advisor to send emails containing the same information, which is only available with the live variant.

By default, both options are disabled. The Custom Expert Advisor will not send or log extended reports.

This feature utilizes the built-in email API of MetaTrader to transmit the information. However, it requires the configuration of the email settings in your MetaTrader instance. These settings can be found in your MetaTrader's Tools - Options menu.

Configuration, Inspector, MetaTrader options menu.png

For email notifications, you can configure the settings under the Email tab.

Configuration, Inspector, MetaTrader notification settings for emails.png

Please refer to the relevant article for a detailed understanding of the necessary parameters to enable these features.

Performance - Daily protection

The inspector engine can be configured to halt trading once a specified daily performance limit is reached using the input parameters outlined in the table below. These parameters establish the daily absolute and relative minimum and maximum thresholds. A value of zero effectively turns off the limit.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Performance day abs min (0.0 -> OFF)
(IN_dAispPerformanceDayAbsMin)
0.0If the account equity is at $10,000 and the minimum value is set at -100, trading will be suspended if the equity falls below $9,900. Trading will resume at the beginning of the next day, with the equity at that moment used as the new reference point.
The input value cannot be greater than 0.
> (AISP) Performance day abs max (0.0 -> OFF)
(IN_dAispPerformanceDayAbsMax)
0.0If the account equity is at $10,000 and the minimum value is set at 100, trading will be suspended if the equity rises above $10,100. Trading will resume at the beginning of the next day, with the equity at that moment used as the new reference point.
The input value cannot be smaller than 0.
> (AISP) Performance day rel min (0.0 -> OFF)
(IN_dAispPerformanceDayRelMin)
0.0If the account equity is at $10,000 and the minimum value is set at -0.15, trading will be suspended if the equity falls below $9,850. The value will be reset, and trading will be reactivated at the next day's start. The equity at the beginning of the next period serves as a new reference value to calculate the performance limits.
The input value cannot be greater than 0.
> (AISP) Performance day rel max (0.0 -> OFF)
(IN_dAispPerformanceDayRelMax)
0.0If the account equity is at $10,000 and the minimum value is set at 0.15, trading will be suspended if the equity rises above $10,150. The value will be reset, and trading will be reactivated at the next day's start. The equity at the beginning of the next period serves as a new reference value to calculate the performance limits.
The input value cannot be smaller than 0.

Separate input parameters exist for the maximum and minimum permissible performance results. This allows the application to suspend the initiation of new trades when positive or negative performance results are achieved. The diagram below elucidates the operational principle of daily inspector protection.

Configuration, Inspector, Inspector function principle for daily performance observation.png

The inspection period is set to one day. If the performance reaches the maximum or minimum value within this period, the ability to open new trades will be temporarily suspended. At the start of a new period, which is at midnight, the performance value for the day is reset, and trading resumes. This cycle continues indefinitely.

Performance - Weekly protection

The inspector engine can be configured to halt trading once a specified weekly performance limit is reached using the input parameters outlined in the table below. These parameters establish the weekly absolute and relative minimum and maximum thresholds. A value of zero effectively turns off the limit.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Performance week abs min (0.0 -> OFF)
(IN_dAispPerformanceWeekAbsMin)
0.0If the account equity is at $10,000 and the minimum value is set at -100, trading will be suspended if the equity falls below $9,900. Trading will resume at the beginning of the next week, with the equity at that moment used as the new reference point.
The input value cannot be greater than 0.
> (AISP) Performance week abs max (0.0 -> OFF)
(IN_dAispPerformanceWeekAbsMax)
0.0If the account equity is at $10,000 and the minimum value is set at 100, trading will be suspended if the equity rises above $10,100. Trading will resume at the beginning of the next week, with the equity at that moment used as the new reference point.
The input value cannot be smaller than 0.
> (AISP) Performance week rel min (0.0 -> OFF)
(IN_dAispPerformanceWeekRelMin)
0.0If the account equity is at $10,000 and the minimum value is set at -0.15, trading will be suspended if the equity falls below $9,850. The value will be reset and trading will be reactivated at the start of the following week. The equity at the beginning of the next period serves as a new reference value to calculate the performance limits.
The input value cannot be greater than 0.
> (AISP) Performance week rel max (0.0 -> OFF)
(IN_dAispPerformanceWeekRelMax)
0.0If the account equity is at $10,000 and the minimum value is set at 0.15, trading will be suspended if the equity rises above $10,150. The value will be reset and trading will be reactivated at the start of the following week. The equity at the beginning of the next period serves as a new reference value to calculate the performance limits.
The input value cannot be smaller than 0.

Separate input parameters exist for the maximum and minimum permissible performance results. This allows the application to suspend the initiation of new trades when positive or negative performance results are achieved. The diagram below elucidates the operational principle of weekly inspector protection.

Configuration, Inspector, Inspector function principle for weekly performance observation.png

The inspection period is set to one week. If the performance reaches the maximum or minimum value within this period, the ability to open new trades will be temporarily suspended. At the start of a new period, which is midnight between Saturday and Sunday, the performance value for the week is reset, and trading is resumed. This cycle continues indefinitely.

Performance - Monthly protection

The inspector engine can be configured to halt trading once a specified monthly performance limit is reached using the input parameters outlined in the table below. These parameters establish the monthly absolute and relative minimum and maximum thresholds. A value of zero effectively turns off the limit.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Performance month abs min (0.0 -> OFF)
(IN_dAispPerformanceMonthAbsMin)
0.0If the account equity is at $10,000 and the minimum value is set at -100, trading will be suspended if the equity falls below $9,900. Trading will resume at the beginning of the next month, with the equity at that moment used as the new reference point.
The input value cannot be greater than 0.
> (AISP) Performance month abs max (0.0 -> OFF)
(IN_dAispPerformanceMonthAbsMax)
0.0If the account equity is at $10,000 and the minimum value is set at 100, trading will be suspended if the equity rises above $10,100. Trading will resume at the beginning of the next month, with the equity at that moment used as the new reference point.
The input value cannot be smaller than 0.
> (AISP) Performance month rel min (0.0 -> OFF)
(IN_dAispPerformanceMonthRelMin)
0.0If the account equity is at $10,000 and the minimum value is set at -0.15, trading will be suspended if the equity falls below $9,850. The value will be reset and trading will be reactivated at the start of the next month. The equity at the beginning of the next period serves as a new reference value to calculate the performance limits.
The input value cannot be greater than 0.
> (AISP) Performance month rel max (0.0 -> OFF)
(IN_dAispPerformanceMonthRelMax)
0.0If the account equity is at $10,000 and the minimum value is set at 0.15, trading will be suspended if the equity rises above $10,150. The value will be reset and trading will be reactivated at the start of the next month. The equity at the beginning of the next period serves as a new reference value to calculate the performance limits.
The input value cannot be smaller than 0.

Separate input parameters exist for the maximum and minimum permissible performance results. This allows the application to suspend the initiation of new trades when positive or negative performance results are achieved. The diagram below elucidates the operational principle of monthly inspector protection.

Configuration, Inspector, Inspector function principle for monthly performance observation.png

The inspection period is set to one month. If the performance reaches the maximum or minimum value within this period, the ability to open new trades will be temporarily suspended. At the start of a new period, which in this case is the 1st day of the month, the performance value for the month is reset, and trading is resumed. This cycle continues indefinitely.

Performance - Yearly protection

The inspector engine can be configured to halt trading once a specified yearly performance limit is reached using the input parameters outlined in the table below. These parameters establish the yearly absolute and relative minimum and maximum thresholds. A value of zero effectively turns off the limit.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Performance year abs min (0.0 -> OFF)
(IN_dAispPerformanceYearAbsMin)
0.0If the account equity is at $10,000 and the minimum value is set at -100, trading will be suspended if the equity falls below $9,900. Trading will resume at the beginning of the next year, with the equity at that moment used as the new reference point.
The input value cannot be greater than 0.
> (AISP) Performance year abs max (0.0 -> OFF)
(IN_dAispPerformanceYearAbsMax)
0.0If the account equity is at $10,000 and the minimum value is set at 100, trading will be suspended if the equity rises above $10,100. Trading will resume at the beginning of the next year, with the equity at that moment used as the new reference point.
The input value cannot be smaller than 0.
> (AISP) Performance year rel min (0.0 -> OFF)
(IN_dAispPerformanceYearRelMin)
0.0If the account equity is at $10,000 and the minimum value is set at -0.15, trading will be suspended if the equity falls below $9,850. The value will be reset and trading will be reactivated at the start of the next year. The equity at the beginning of the next period serves as a new reference value to calculate the performance limits.
The input value cannot be greater than 0.
> (AISP) Performance year rel max (0.0 -> OFF)
(IN_dAispPerformanceYearRelMax)
0.0If the account equity is at $10,000 and the minimum value is set at 0.15, trading will be suspended if the equity rises above $10,150. The value will be reset and trading will be reactivated at the start of the next year. The equity at the beginning of the next period serves as a new reference value to calculate the performance limits.
The input value cannot be smaller than 0.

Separate input parameters exist for the maximum and minimum permissible performance results. This allows the application to suspend the initiation of new trades when positive or negative performance results are achieved. The diagram below elucidates the operational principle of the yearly inspector protection.

Configuration, Inspector, Inspector function principle for yearly performance observation.png

The inspection period is set to one year. If the performance reaches the maximum or minimum value within this period, the ability to open new trades will be temporarily suspended. At the start of a new period, which in this case is on the 1st of January, the performance value for the year is reset, and trading resumes. This cycle continues indefinitely.

Performance - Since start protection

The inspector engine can be configured to halt trading once a specified performance limit is reached using the input parameters outlined in the table below. These parameters establish the absolute and relative minimum and maximum thresholds. A value of zero effectively turns off the limit.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Performance since start abs min (0.0 -> OFF)
(IN_dAispPerformanceSinceStartAbsMin)
0.0If the account equity is at $10,000 and the minimum value is set at -100, trading will be suspended if the equity falls below $9,900.
The input value cannot be greater than 0.
> (AISP) Performance since start abs max (0.0 -> OFF)
(IN_dAispPerformanceSinceStartAbsMax)
0.0If the account equity is at $10,000 and the minimum value is set at 100, trading will be suspended if the equity rises above $10,100.
The input value cannot be smaller than 0.
> (AISP) Performance since start rel min (0.0 -> OFF)
(IN_dAispPerformanceSinceStartRelMin)
0.0If the account equity is at $10,000 and the minimum value is set at -0.15, trading will be suspended if the equity falls below $9,850.
The input value cannot be greater than 0.
> (AISP) Performance since start rel max (0.0 -> OFF)
(IN_dAispPerformanceSinceStartRelMax)
0.0If the account equity is at $10,000 and the minimum value is set at 0.15, trading will be suspended if the equity rises above $10,150.
The input value cannot be smaller than 0.

Separate input parameters exist for the maximum and minimum permissible performance results. This allows the application to suspend the initiation of new trades when positive or negative performance results are achieved. The diagram below elucidates the operational principle of inspector protection.

Configuration, Inspector, Inspector function principle for since start performance observation.png

The inspection period begins when the application is started. If the performance reaches the maximum or minimum value, the ability to open new trades will be permanently suspended.

Performance - Example

The charts below provide examples of a trading system with a) a maximum performance of -2% per day and b) a performance of -2% since the application started.

Configuration, Inspector, Inspector example of performance observation and disabling of trading.png

In both example charts, the trading modules cease to open trades as soon as the -2 % performance limit is reached. Chart b) keeps all trading modules deactivated indefinitely, whereas chart a) only temporarily turns off the trading module until the next day's start. As a result, chart a) contains two periods without trading, as the -2% limit was reached on both days.

Drawdown - Daily protection

The inspector engine can be configured to halt trading once a specified daily drawdown limit is reached using the input parameters outlined in the table below. These parameters establish the daily absolute and relative maximum thresholds. A value of zero effectively turns off the limit.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Drawdown day abs max (0.0 -> OFF)
(IN_dAispDrawdownDayAbsMax)
0.0If the account equity is set at $10,000 and the maximum value is set at 100, trading will be halted if the drawdown exceeds $100 within a day. Trading will resume at the beginning of the next day, with the equity at that moment used as the new reference point.
The input value cannot be smaller than 0.
> (AISP) Drawdown day rel max (0.0 -> OFF)
(IN_dAispDrawdownDayRelMax)
0.0If the account equity is set at $10,000 and the maximum value is set at 0.15, trading will be halted if the drawdown exceeds $150 within a day. Trading will resume at the beginning of the next day, with the starting equity as the reference point. The new reference value is used to calculate the next drawdown limits.
The input value cannot be smaller than 0.

Input parameters exist for the maximum permissible drawdown results. This allows the application to suspend the initiation of new trades when bad performance values are surpassed. The diagram below elucidates the operational principle of daily inspector protection.

Configuration, Inspector, Inspector function principle for daily drawdown observation.png

The inspection period is set to one day. If the drawdown reaches the maximum value within this period, the ability to open new trades will be temporarily suspended. At the start of a new period, which is at midnight, the drawdown value for the day is reset, and trading is resumed. This cycle continues indefinitely.

Drawdown - Weekly protection

The inspector engine can be configured to halt trading once a specified weekly drawdown limit is reached using the input parameters outlined in the table below. These parameters establish the weekly absolute and relative maximum thresholds. A value of zero effectively turns off the limit.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Drawdown week abs max (0.0 -> OFF)
(IN_dAispDrawdownWeekAbsMax)
0.0If the account equity is set at $10,000 and the maximum value is set at 100, trading will be halted if the drawdown exceeds $100 within a week. Trading will resume at the beginning of the next week, with the equity at that moment used as the new reference point.
The input value cannot be smaller than 0.
> (AISP) Drawdown week rel max (0.0 -> OFF)
(IN_dAispDrawdownWeekRelMax)
0.0If the account equity is set at $10,000 and the maximum value is set at 0.15, trading will be halted if the drawdown exceeds $150 within a week. Trading will resume at the beginning of the next week, with the starting equity as the reference point. The new reference value is used to calculate the next drawdown limits.
The input value cannot be smaller than 0.

Input parameters exist for the maximum permissible drawdown results. This allows the application to suspend the initiation of new trades when bad performance values are surpassed. The diagram below elucidates the operational principle of daily inspector protection.

Configuration, Inspector, Inspector function principle for weekly drawdown observation.png

The inspection period is set to one week. If the drawdown reaches the maximum value within this period, the ability to open new trades will be temporarily suspended. At the start of a new period, which in this case is midnight between Saturday and Sunday, the drawdown value for the day is reset, and trading is resumed. This cycle continues indefinitely.

Drawdown - Monthly protection

The inspector engine can be configured to halt trading once a specified monthly drawdown limit is reached using the input parameters outlined in the table below. These parameters establish the monthly absolute and relative maximum thresholds. A value of zero effectively turns off the limit.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Drawdown month abs max (0.0 -> OFF)
(IN_dAispDrawdownMonthAbsMax)
0.0If the account equity is set at $10,000 and the maximum value is set at 100, trading will be halted if the drawdown exceeds $100 within a month. Trading will resume at the beginning of the next month, with the equity at that moment used as the new reference point.
The input value cannot be smaller than 0.
> (AISP) Drawdown month rel max (0.0 -> OFF)
(IN_dAispDrawdownMonthRelMax)
0.0If the account equity is set at $10,000 and the maximum value is set at 0.15, trading will be halted if the drawdown exceeds $150 within a month. Trading will resume at the beginning of the next month, with the starting equity as the reference point. The new reference value is used to calculate the next drawdown limits.
The input value cannot be smaller than 0.

Input parameters exist for the maximum permissible drawdown results. This allows the application to suspend the initiation of new trades when bad performance values are surpassed. The diagram below elucidates the operational principle of daily inspector protection.

Configuration, Inspector, Inspector function principle for monthly drawdown observation.png

The inspection period is set to one month. If the drawdown reaches the maximum value within this period, the ability to open new trades will be temporarily suspended. At the start of a new period, which is the 1st day of the month, the drawdown value for the day is reset, and trading is resumed. This cycle continues indefinitely.

Drawdown - Yearly protection

The inspector engine can be configured to halt trading once a specified yearly drawdown limit is reached using the input parameters outlined in the table below. These parameters establish the yearly absolute and relative maximum thresholds. A value of zero effectively turns off the limit.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Drawdown year abs max (0.0 -> OFF)
(IN_dAispDrawdownYearAbsMax)
0.0If the account equity is set at $10,000 and the maximum value is set at 100, trading will be halted if the drawdown exceeds $100 within a year. Trading will resume at the beginning of the next year, with the equity at that moment used as the new reference point.
The input value cannot be smaller than 0.
> (AISP) Drawdown year rel max (0.0 -> OFF)
(IN_dAispDrawdownYearRelMax)
0.0If the account equity is set at $10,000 and the maximum value is set at 0.15, trading will be halted if the drawdown exceeds $150 within a year. Trading will resume at the beginning of the next year, with the starting equity as the reference point. The new reference value is used to calculate the next drawdown limits.
The input value cannot be smaller than 0.

Input parameters exist for the maximum permissible drawdown results. This allows the application to suspend the initiation of new trades when bad performance values are surpassed. The diagram below elucidates the operational principle of daily inspector protection.

Configuration, Inspector, Inspector function principle for yearly drawdown observation.png

The inspection period is set to one year. If the drawdown reaches the maximum value within this period, the ability to open new trades will be temporarily suspended. At the start of a new period, which is on the 1st of January, the drawdown value for the day is reset, and trading is resumed. This cycle continues indefinitely.

Drawdown - Since start protection

The inspector engine can be configured to halt trading once a specified drawdown limit is reached using the input parameters outlined in the table below. These parameters establish the absolute and relative maximum thresholds. A value of zero effectively turns off the limit.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (AISP) Drawdown since start abs max (0.0 -> OFF)
(IN_dAispDrawdownSinceStartAbsMax)
0.0If the account equity is set at $10,000 and the maximum value is set at 100, trading will be halted if the drawdown exceeds $100.
The input value cannot be smaller than 0.
> (AISP) Drawdown since start rel max (0.0 -> OFF)
(IN_dAispDrawdownSinceStartRelMax)
0.0If the account equity is set at $10,000 and the maximum value is set at 0.15, trading will be halted if the drawdown exceeds $150.
The input value cannot be smaller than 0.

Input parameters exist for the maximum permissible drawdown results. This allows the application to suspend the initiation of new trades when bad performance values are surpassed. The diagram below elucidates the operational principle of daily inspector protection.

Configuration, Inspector, Inspector function principle for since start drawdown observation.png

The inspection period begins when the application is started. If the drawdown reaches the maximum value, the ability to open new trades will be permanently suspended.

Drawdown - Example

The charts below provide examples of a trading system with a) a maximum drawdown of -2% per day and b) a drawdown of -2% since the application started.

Configuration, Inspector, Inspector example of drawdown observation and disabling of trading.png

In both example charts, the trading modules cease to open trades as soon as the -2 % drawdown limit is reached. Chart b) keeps all trading modules deactivated indefinitely, whereas chart a) only temporarily turns off the trading module until the next day's start. As a result, chart a) contains two periods without trading, as the -2% limit was reached on both days.