OPEN-SOURCE SCRIPT
Telah dikemas kini

ANN Trend Prediction

3 678
This trend indicator utilizes an artificial neural network (ANN) to predict the next market reversal within a certain range of previous candles. The larger the range of previous candles you set, the fewer reversals will be predicted, and trends will tend to last longer.

The ANN is trained on the BTCUSD 4-hour chart, so using it on other assets or timeframes may yield suboptimal results. It takes three input values: the closing price, the Stochastic RSI, and a Choppiness Indicator. Based on these inputs, the ANN categorizes the current candle as part of an uptrend, downtrend, or as undefined.

syot kilat

Compared to an EMA-based trend indicator, this ANN identifies reversals several candles earlier. It achieves this by detecting subtle patterns in the input values that typically appear before a market turnaround. These patterns are somewhat specific to that chosen asset and timeframe.

syot kilat

The results are displayed using rows of triangles that indicate the predicted price direction. The price levels of the triangles correspond to the closing price at the last reversal. The area between the triangle row and the price is colored green if the ANN correctly predicted the move, and red if it did not.

This indicator is designed to showcase the capabilities and potential of ANNs, and is not intended for actual trading use. The ANN can be trained on any other input values, assets and timeframes for several predictions tasks.

You can use the Predicted_Trend_Signal of this Indicator in any backtest indicator. In the Backtester just grap the Predicted_Trend_Signal. downtrend = 1, uptrend = -1, undefined = 0

Feel free to write me a comment.
Nota Keluaran
Updated the Exported Trade Signal:
A predicted uptrend is now indicated by any value greater than zero. This value represents the close price at the first occurrence of the trend, as shown in Image U1.
A downtrend is indicated by any value less than zero. The absolute value corresponds to the close price at the first occurrence of the downtrend.
If the value is zero the script has no prediction.
In summary:

  • The sign indicates the trend direction (positive for up, negative for down).
  • The absolute value represents the earliest possible entry price.


syot kilat
Image U1

Add Trade Signal Age for export:
The Trade Signal Age is the number of bars since first occurrence of the trend.

This updates offers more compatibility with my backtest/strategy template script. Now you can for example easily abort a trade after x bars OR just enter a new Trade if the difference between the previous enter price and actual trends enter price is big enough.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.