TFM — Strategy by OneHolo

By OneHolo

Performance Metrics

Description

TFM Strategy ExplanationOverviewThe TFM (Timeframe Multiplier) strategy is a PineScript trading bot that utilizes multiple timeframes to identify entry and exit points.Inputs1. 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.LogicCalculations1. 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 Exits1. 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.Strategy1. Attach the script to a chart.2. Adjust tfm and lns inputs.3. Monitor entries and exits.Example Use Cases1. Intraday trading with tfm = 2-5.2. Swing trading with tfm = 10-30.Tips1. Experiment with different tfm values.2. Use lns to control short positions.3. Combine with other indicators for confirmation.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView