TWR - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources - MetaTrader 5 Resources





TWR is calculated based on the color of the previous bar and the closing price of the current bar, ignoring other price information and actually redrawing the candle using the closing price.
Color definition:
Define the color of the first bar:
On > Off - green; On < Off - red;
Note (just to aid understanding, the index order of the actual code is reversed):
The calculation principle is as follows:
1. Uptrend:

Figure 1: Calculation principle of uptrend

Figure 2: Downtrend calculation principle
Classic turn signal light:

Figure 3: Uptrend Signal Reversal

Figure 4: Downtrend Signal Reversal
3. Actually, we can add EMA to filter the noise signal and improve the signal quality.
If TWR gives us a trend signal and the bar closes above or below the EMA, then the trend is true.

Figure 5: Example
Attachment download
📎twr.mq5 (7.55 KB)
Source: MQL5 #20656
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •