HalfTrend with Signal Stats
- 지표
- 버전: 1.0
An independent MetaTrader 4 implementation of the classic HalfTrend method, as popularised on TradingView by everget. It was written from the method description. Credit for the method goes to its authors.
Also available for MetaTrader 5 (free): https://www.mql5.com/en/market/product/212443
What it shows
- A stepped trend line. In an up-trend it follows the highest low of the last bars and only moves up; in a down-trend it follows the lowest high and only moves down.
- The trend turns down when the moving average of highs falls below the highest low of the trend and the bar closes below the previous low; it turns up the opposite way. Amplitude sets how many bars are used.
- A Buy or Sell arrow on the bar where the trend turns, half an ATR away from the line.
- Optional ATR channel around the line (channel deviation x ATR/2).
Default inputs: Amplitude 2, Channel deviation 2, ATR 100. The ATR is Wilder's average. The built-in MetaTrader 4 ATR is a simple average, so versions that use it can show slightly different channels.
Made for MetaTrader 4
- No repainting. The line and the arrows of a closed bar never change afterwards. Signals appear on the closed bar only.
- Alerts on a new signal: popup, sound only, push notification to the MetaTrader mobile app, or e-mail. Once per signal, on the closed bar.
- Signal statistics panel. It buys at the open of the bar after a Buy signal, sells after a Sell signal, and closes and reverses at the opposite signal. It shows trades, win rate, the net result in money at your lot size after spread and commission, the result before costs, profit factor, average win and loss, longest losing streak, maximum drawdown, the open trade and the cost per trade. Click the header to fold it to one line; put it in any corner. Colors follow your chart, dark or light.
- Trade marks on the chart: hover a mark to see prices, exit reason and result.
- Optional daily session filter for the statistics, in your own time zone (overnight windows allowed), with session shading and an optional close at session end. Off by default.
- Works on any symbol and timeframe. Only new bars are calculated after the first load.
For EA developers
buffer 6 = HalfTrend line, 7 = trend (0 up, 1 down), 8 = ATR, 2 / 3 = channel upper / lower, 4 = Buy, 5 = Sell (arrow price on the signal bar, EMPTY_VALUE otherwise). Simplest call with the default inputs: iCustom(NULL, 0, "Market\\HalfTrend with Signal Stats", buffer, shift) . If you pass inputs, each separator line in the inputs counts as one parameter (pass an empty string for it). Values on the closed bar (shift 1) are final.
The panel describes what past signals would have done under the simple rule above, after the costs you set. It is not a backtest with stop-loss or take-profit, it is not a trading system and it says nothing about future results. Check the cost line first: on 1 to 5 minute charts the spread and commission per trade are often large compared with the average move between two signals.
This is a visual tool. It does not place trades and does not predict prices. Test any rule built on it before you trade with it.
