Capital ATR
- Experts
- Mr Nisit Noijeam
- 버전: 1.2
- 활성화: 10
Expert Advisor (EA) for MetaTrader 4 (MT4) platform, named MTRADER. Its primary strategy appears to be a grid trading strategy based on moving averages and average true range (ATR) volatility.
Here's a breakdown of its key components and functionalities:
-
Initialization Parameters:
- It defines various input parameters such as Moving Average Type (Simple, Exponential, Smoothed, or Linear Weighted), Moving Average Period, ATR Period, ATR Factor, Initial Lot Size, etc. These parameters can be adjusted by the user according to their trading preferences.
-
Initialization Function (OnInit):
- This function is called when the EA is initialized. In this script, it simply returns INIT_SUCCEEDED , indicating successful initialization.
-
CheckTradeHistory Function:
- This function checks the trade history to adjust lot sizes based on consecutive losses. It counts the number of consecutive losing trades for both buy and sell orders and adjusts the lot size accordingly.
-
NormalizeLotSize Function:
- This function ensures that the lot size remains within the minimum and maximum allowed values for trading on the specific symbol.
-
OnTick Function:
- This function is executed on every tick (price change) of the symbol.
- It calculates the moving average (based on the selected type) and the ATR.
- It then checks for open orders and their type (buy or sell).
- If there are no open orders, it checks if conditions are met to open new buy or sell orders based on the grid strategy.
- If there are open orders, it checks if conditions are met to close them (e.g., if price crosses the moving average).
- It handles order opening and closing, and also includes features like Take Profit (TP) based on ATR, lot size normalization, and error handling.