Trend-Following EA with Technical Indicators and Risk Management

taseee

Active member
Messages
125
Likes
4
The attached expert advisor is a trading algorithm for the EURCHF currency pair. It uses a variety of technical indicators to determine when to enter and exit trades, including the iWPR, iATR, iRSI, GetEFF, and GetMM indicators. The algorithm also uses a variety of risk management techniques, such as stop losses and take profits.

Here is a more detailed explanation of how the algorithm works:

  1. The algorithm first checks if the current day of the week is a Sunday or Friday. If it is, the algorithm will not trade, as these days are typically less volatile.
  2. If the current day of the week is not a Sunday or Friday, the algorithm will then check if the current hour is within the trading window. The trading window is defined by the StartHour and EndHour variables. If the current hour is within the trading window, the algorithm will then begin to analyze the technical indicators.
  3. The algorithm first calculates the iWPR indicator. The iWPR indicator is a momentum indicator that measures the strength of a trend. The algorithm then calculates the iATR indicator. The iATR indicator is a volatility indicator that measures the average true range of a currency pair over a specified period of time. The algorithm then calculates the iRSI indicator. The iRSI indicator is a momentum indicator that measures the strength of a trend relative to its recent price history. Finally, the algorithm calculates the GetEFF indicator. The GetEFF indicator is a trend filter that measures the strength of a trend relative to its recent price history.
  4. The algorithm then uses the values of the technical indicators to determine whether to enter a long or short trade. If the iWPR indicator is above a certain value and the iRSI indicator is above 50, the algorithm will enter a long trade. If the iWPR indicator is below a certain value and the iRSI indicator is below 50, the algorithm will enter a short trade.
  5. The algorithm also uses a variety of risk management techniques. The algorithm uses a stop loss to limit the amount of money that can be lost on a trade. The algorithm also uses a take profit to limit the amount of money that can be made on a trade.
  6. The algorithm finally checks if the current equity is greater than the gd_260 variable. If it is, the algorithm will close all of its trades and wait for the next day to trade.
 

Attachments

  • CueMasterEA.zip
    202.5 KB · Views: 21
Friends, I am posting a test of the advisor on Darwinex quotes in Tick Data Suite with a real spread, without slippage. Default settings.

1696535236488.png
 
CueMaster have .dll file and tester did not support the .dll file. how can you test it?
Enabled the use of library files in the terminal settings. The corresponding file is placed in the libraries directory. The question arises, what is the dll file used for?

1696571177202.png
 
Very interesting, tell me what needs to be done then to get such a result? Well, by the way, you are using a test with a fixed spread, and this is a very poor imitation of real trading conditions.
I only trust on live trading account testing. The tester is only time to waste. I need EA for present market trend. The past has gone.
 
I completely disagree. Without knowing the past, you cannot predict the future. How did you build your system then, just a finger in the sky?

Yes, and you give the test results. And you say that it is not possible to test it.
 
Here is a more detailed explanation of the GetEFF and GetMM indicators:

  • The GetEFF indicator is a trend filter that measures the strength of a trend relative to its recent price history. The GetEFF indicator is calculated using the following formula:
GetEFF(ai_0, a_applied_price_4 = 0, ai_8 = 10, a_period_12 = 5, a_period_16 = 5, a_ma_method_20 = 0, ai_24 = 0)

where:

  • ai_0 is the current bar index
  • a_applied_price_4 is the applied price (0 for close price, 1 for open price, 2 for high price, 3 for low price, 4 for median price, 5 for typical price)
  • ai_8 is the period for the first moving average
  • a_period_12 is the period for the second moving average
  • a_period_16 is the period for the third moving average
  • a_ma_method_20 is the moving average method (0 for SMA, 1 for EMA, 2 for WMA)
  • ai_24 is the mode (0 for absolute value, 1 for percentage)
The GetEFF indicator returns a value between 0 and 100. A higher GetEFF value indicates a stronger trend.

  • The GetMM indicator is a trend filter that measures the strength of a trend relative to its recent price history. The GetMM indicator is calculated using the following formula:
GetMM(ai_0, int a_period_4, double ad_8, int ai_16)
where:

  • ai_0 is the current bar index
  • a_period_4 is the period for the moving average
  • ad_8 is the threshold value
  • ai_16 is the mode (0 for long, 1 for short, 2 for flat)
The GetMM indicator returns a value of 0, 1, or 2. A value of 0 indicates that the trend is up, a value of 1 indicates that the trend is down, and a value of 2 indicates that the trend is flat.
 
Top