Lightness MT5 is an innovative forex software developed by the Forex Robot Easy Team. It is designed to trade on the AUDCAD and CADCHF currency pairs. This code serves as a sample implementation of the Lightness MT5 strategy.
To run this code, you will need to have the following libraries installed:
- Trade.mqh
- Expert.mqh
- Trend.mqh
CTrade trade
- Trade class objectCTrend trend
- Trend indicator class object
The OnInit()
function is called during the initialization of the expert advisor. In this function, we set the EA parameters:
trade.SetExpertMagicNumber(123456)
- Set the magic number for trade operationstrade.SetExpertStopLoss(50)
- Set the stop loss value in pipstrade.SetExpertTakeProfit(100)
- Set the take profit value in pips
We also apply the trend indicator settings:
trend.SetPeriod(14)
- Set the period for calculating trendtrend.SetMethod(MODE_SMA)
- Set the method for calculating trend
The OnDeinit()
function is called during the deinitialization of the expert advisor. It can be used to perform any necessary cleanup.
The OnTick()
function is called on every tick of the price chart. In this function, we check if the AUDCAD and CADCHF currency pairs are trending using the trend.iCustom()
function.
- If the trend is up, we enter a long trade on the respective currency pair using the
trade.Buy()
function. - If the trend is down, we enter a short trade on the respective currency pair using the
trade.Sell()
function.
The OnStop()
function is called before the expert advisor stops. It can be used to perform any necessary actions.
For detailed reviews and trading results of the Lightness MT5 product, please visit the official developer's site: Lightness MT5 - Forex Robot Easy
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 product. To find the official developer of this product, please refer to MQL5.