OPEN-SOURCE SCRIPT

TFM

TFM Strategy Explanation

Overview

The TFM (Timeframe Multiplier) strategy is a PineScript trading bot that utilizes multiple timeframes to identify entry and exit points.

Inputs

1. tfm (Timeframe Multiplier): Multiplies the chart's timeframe to create a higher timeframe for analysis.
2. lns (Long and Short): Enables or disables short positions.

Logic

Calculations

1. chartTf: Gets the chart's timeframe in seconds.
2. tfTimes: Calculates the higher timeframe by multiplying chartTf with tfm.
3. MintickerClose and MaxtickerClose: Retrieve the minimum and maximum closing prices from the higher timeframe using request.security.
- MintickerClose: Finds the lowest low when the higher timeframe's close is below its open.
- MaxtickerClose: Finds the highest high when the higher timeframe's close is above its open.

Entries and Exits

1. Long Entry: When the current close price crosses above MaxtickerClose.
2. Short Entry (if lns is true): When the current close price crosses below MintickerClose.
3. Exit Long: When the short condition is met (if lns is false) or when the trade is manually closed.

Strategy

1. Attach the script to a chart.
2. Adjust tfm and lns inputs.
3. Monitor entries and exits.

Example Use Cases

1. Intraday trading with tfm = 2-5.
2. Swing trading with tfm = 10-30.

Tips

1. Experiment with different tfm values.
2. Use lns to control short positions.
3. Combine with other indicators for confirmation.
Candlestick analysisChart patternsmultitimeframe

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?


更多:

免责声明