The Traffic Light Robot uses four moving averages, logically named Red, Green, Blue, and Yellow. The Red Moving Average (RMA) is a Simple Moving Average (SMA) of the Close calculated using the Red MA period. The Green Moving Average (GMA) is an Exponential Moving Average (EMA) of the Close calculated using the GreenMAperiod. Similarly, the Yellow Moving Average (YMA) is an SMA of the Close calculated over the Yellow MA period. There are two components calculated using the BlueMA period, namely the EMA of the High, termed BMA(H), and the EMA of the Low, termed BMA(L).
A LONG entry is triggered when the Bid price is above GMA, and, GMA is above BMA(H), and BMA(H)is above YMA, and finally, YMA is above RMA. On the contrary, a SHORT entry is triggered when the Bid price is below the GMA, which is below the BMA(L), which is below YMA, which in turn is below RMA. The order is listed below,
LONG Entry = Bid > GMA > BMA(High)> YMA > RMA
SHORT Entry = Bid < GMA < BMA(Low)< YMA < RMA
This sequence is important as it ensures the convergence of the trend. It should be noted that the ROBOT uses the Blue Moving Average High for LONG entries, and Blue Moving Average Low for SHORT entries. This distinction of using High for LONG and Low for SHORT is important in order to ensure that the trend is strong and to filter out false signals. The value of Red MA should be the largest followed by Yellow MA, then by BlueMA. The value of Green MA should be the smallest.
When the Moving Averages converge in the order mentioned above, there is a high potential of a strong trend forming and generating highly profitable trades.
The ROBOT can be configured to check for entry signal conditions start of the new candle or continuously by setting the OpenBarTime to 1 or 0 respectively. The lot size of a trade can be configured in two ways, (a) Fixed Lot Size, by setting MM_MODE to 0 and using MM_LOTS as the lot-size. (b) Calculated based on risk per trade, by setting MM_MODE to 1, and calculating the lot-size based on the Account Balance, RiskPercent, and StopLossinput parameters.
If CloseProfit is set to 1, a LONG trade is closed when the Green Moving Average is below the Yellow Moving Average. Similarly, a SHORT trade is closed when the Green Moving Average is above the Yellow Moving Average. This ensures that trade does not incur huge losses as the trend reversals and we exit the losing trade quickly.
To prevent entry and exit on the same candle the TimeCloseBar input can be set to 1. When set to 1, the ROBOT waits for the candle on which the trade was opened to check for exit condition. However, the trailing stop is always evaluated supersedes the TimeCloseBar parameter. The ROBOT has at most only one open trade at a time.
This ROBOT employs a trailing stop mechanism based on moving average to protect profits. When the TRAILING parameter is set to 1 and the trade profit is at lRobot st TrailStopMA pips the trailing stop mechanism is activated. The stop-loss is set to the SMAcalculated from the TrailMA period. The trailing stop is incremented by TrailStep pips.
[You must be registered and logged in to see this link.][You must be registered and logged in to see this image.]