The Expert Advisor determines the direction of the trend and gives an estimate of the strength of the trend in percentage terms (the maximum value is naturally taken as 100%).
The assessment is based on the definition of the following three components:
The maximum value of the trend strength of 100% is the market situation, when the trend that is emerging on a small timeframe is confirmed in the medium term and coincides in the direction with the long-term trend.
Indicators are not used when analyzing the state of the market. Only mathematical processing of market data of several timeframes according to the original formula.
Attention! The Expert Advisor does not have any ambitious tasks for predicting the future, only an assessment of the current state of the market (of course, with the right to make mistakes).
Practical application of the Expert Advisor:
- attach the Expert Advisor to the window with the required tool;
- if there is no open position on this instrument when the “new bar” event occurs, the Expert Advisor will display a message in the “alerts” window with the direction and “strength” of the trend;
- if the option to issue trading recommendations was enabled when launching the Expert Advisor, then in the same window you will be asked to make a buy or sell trade operation with the lot size taking into account the “strength” of the trend and the size of the deposit;
- the decision to follow the recommendations or not, as well as directly performing a trading operation, is the responsibility of the user.
[spoiler title=”Read More…”]
To illustrate the suitability of using this Expert Advisor in trading and for the user to develop techniques and strategies for their trading, the following option is provided in the Expert Advisor:
- In the tester, the Expert Advisor is launched in the trading mode with the parameters set by the user, it is possible to start optimization (due to some internal limitations of the tester, it should be noted that the “PeriodCalc” parameter should not have a value greater than 12 when running in the tester).
When working with the Expert Advisor, the set values of the following parameters are important:
- Awareness_and_Acceptance_of_Risk – risk acceptance by the user (understanding the risk and agreeing to take the risk), without this, the Expert Advisor only works in the tester;
- SLIPPAGE – acceptable slippage when executing a trade order;
- KSL – the set value of the stop loss in the minimum allowable stop levels;
- KTP – the set value of the take profit in the minimum allowed stop levels;
- PeriodCalc-sets the number of history bars used by the Expert Advisor when determining the trend (recommended 10-20);
- KP-sets the” sensitivity threshold “of the Expert Advisor, i.e. the minimum value of the “trend strength” for identifying the trend as a trend (optimally 40-90);
- ModeHuru-enables (1) or disables (0) the mode when the Expert Advisor issues recommendations for making a purchase or sale with the lot size calculated based on the “trend strength” and the size of the current balance;
- AggressiveModeMM-select the “aggressive” mode of funds management (the current value of the trade balance is taken into account in calculating the size of the traded lot).
[/spoiler]