This ReadMe file provides an overview of the code for the Mad Gold Scalper EA and describes how it works. Please note that ForexRobotEasy is not the official developer of this product. We only provide a sample code that can work as described in the official product.
For detailed reviews and trading results of this product, please visit Forex Robot Easy.
The Mad Gold Scalper EA implements a quick trading strategy on Gold (XAUUSD) to execute trades efficiently. It aims to take advantage of price movements in the gold market.
The EA provides flexibility for users to choose between higher and lower risk settings. By adjusting the UseHigherRisk
flag, users can select their preferred risk level. The EA also incorporates a safe stop loss and maximum lot size options to ensure compatibility with funded accounts like FTMO.
The Mad Gold Scalper EA enables users to configure filters for economic, federal, and job-related news events. By using the UseNewsFilter
flag, users can choose to enable or disable news filtering. This feature ensures that the EA is always informed and prepared for market fluctuations.
To avoid manipulation or backtest conditioning, the EA integrates real backtest data with a 99.9% modeling quality. This ensures that the results provided by the EA are accurate and reliable for traders.
The code is structured as follows:
The necessary include files are included at the beginning of the code.
Global variables such as StopLossPips
, MaxLotSize
, UseHigherRisk
, and UseNewsFilter
are defined. These variables allow users to customize the EA's behavior and risk management settings.
The MadGoldScalperEA
class is defined, which inherits from the Expert
class. This class represents the main logic of the EA.
The constructor initializes the variables for the trading strategy and risk management.
The OnTick
function is called on each tick of the symbol. It implements the quick trading strategy on Gold (XAUUSD) based on the current risk settings. It also places buy or sell orders based on the price movements and updates the lastTradePrice
variable.
The OnChartEvent
function is called when a chart event occurs. If the news filter is enabled (UseNewsFilter
flag is true) and the chart event is a relevant news event (economic, federal, or job-related), the trading strategy is adjusted accordingly by setting UseHigherRisk
to true. Otherwise, UseHigherRisk
is set to false.
The OnInit
function initializes the expert advisor by creating an instance of the MadGoldScalperEA
class. The OnDeinit
function deinitializes the expert advisor by removing it.
The OnTick
and OnChartEvent
functions are defined as entry points for the expert advisor. These functions call the respective functions of the MadGoldScalperEA
class.
The OnTester
function is called during backtesting. It uses real backtest data with a 99.9% modeling quality to simulate trading using the EA.
The OnCalculate
function is called to calculate custom indicators if needed. In this code, no indicator calculation is needed, so the function returns the total number of rates.
Please note that ForexRobotEasy is not the official developer of the Mad Gold Scalper EA. We only provide a sample code that can work as described in the official product. To find the official developer of this product, please use MQL5.