TIMEFRAME (ProScreener)

Category: ProScreener

The TIMEFRAME function in ProScreener, part of the ProRealTime trading platform, allows users to specify the time period for which the screening conditions should be evaluated. This function is crucial for traders who need to analyze multiple timeframes simultaneously to make informed decisions based on various technical indicators across different periods.

Syntax:

TIMEFRAME(time_period)

Purpose:

The TIMEFRAME function is used to set the temporal context for the calculations of indicators and conditions within a screener script. By default, screeners run on the current timeframe of the chart. However, with TIMEFRAME, you can override this to check conditions on different timeframes without changing the chart itself.

Example:

Consider a scenario where you want to screen stocks that are showing a bullish MACD crossover on a weekly timeframe, but are currently oversold on a daily timeframe based on the Stochastic indicator.

REM Define MACD on a weekly timeframe
TIMEFRAME(weekly)
weeklyMACD = MACD[12,26,9](Close)
bullishCrossover = weeklyMACD crosses over weeklyMACD[1]

REM Define Stochastic on a daily timeframe
TIMEFRAME(daily)
dailySto = Stochastic[14,3](Close)
oversold = dailySto < 30

REM Screener criteria
SCREENER[bullishCrossover AND oversold]

Explanation:

  • The script first sets the timeframe to 'weekly' and calculates the MACD indicator. It then checks if there is a bullish crossover.
  • Next, it switches the timeframe to 'daily' and calculates the Stochastic indicator to determine if the stock is oversold.
  • The final screener line uses both conditions to filter stocks that meet both criteria.

Additional Information:

When using the TIMEFRAME function, it's important to remember that each TIMEFRAME call affects all lines of code that follow it until another TIMEFRAME call is made. This allows for complex conditions involving multiple timeframes to be easily scripted and evaluated.

Understanding and utilizing the TIMEFRAME function can significantly enhance the flexibility and depth of your market analysis, allowing for more nuanced and sophisticated trading strategies.

Related Instructions:

Logo Logo
Loading...