🌸 SPRING SALE 🌸 Get 35% OFF with code: SPRINGSALE – Valid until April 22, 2025

Precision Trading Insights with Smart Institutional Order Flow

Optimize Your Trading Logic

Advanced Options for tweaking performance

 
Optimize your Cacluclations - Advanced Options
 

Options

  • Lookahead: Determines how data from higher timeframes is processed. Enabling this option can sometimes lead to unexpected behaviors, such as order blocks marked as “possible” on lower timeframes even though they exist on higher timeframes. Adjust the settings if needed. More information: here
  • Gaps Merge: Controls how gaps from higher timeframes are handled. Useful for reducing clutter in complex analyses.
  • Show Debug Window: Enables a debug overlay for troubleshooting. Helpful for understanding internal indicator behavior.

Filters

  • Filter Historical Lines Smaller Than X Bars: Removes historical lines shorter than the specified number of bars (default: 1).

This option could lead to some strange side effects: How to fix it?

Debugging

  • Delay for Rendering (only for debugging): Adds a delay for visual debugging purposes. Default is set to 100 milliseconds.
  • Choose Strategy (only for debugging): Allows the selection of a strategy for debugging. Options are available in a dropdown. There are various strategies for deleting old graphical elements to make space for new ones. In addition to lines, this also includes rectangles and labels that need to be continuously removed. Different garbage collection strategies can be configured here, which influence which objects are deleted first.

Show Number of Fair Value Gaps

  • Fair Value Gaps are displayed as rectangles. Unfortunately, these are limited in Pine Script, and it is necessary to share this limitation with other functions of the indicator. For example, rectangles are also required for clustering and FVG blocks. However, it’s important to note that significant Fair Value Gaps are represented by Breaker Blocks, which is why this option can be kept low or even completely disabled.

Garbage Collection Strategies in IOF Pro Explained

1. Strategy 1: Deleting the Oldest Line (Global View)

  • Logic:

    • Identify the oldest line by calculating the distance from the current bar and delete it.

  • Key Steps:

    • Check the bar_distance for all lines.

    • Remove the line with the maximum distance (furthest back in time).

  • When to use:

    • When you want to clean up the chart by removing lines that are the least relevant to the current price action.

Pros:

  • Precise cleanup targeting the least relevant (oldest) lines.

Cons:

  • Can be slower due to looping through many lines.

Garbage Collection Strategies: Deleting the Oldest Line

2. Strategy 1b: Prioritized Deletion of Inactive Lines

  • Logic:

    • This strategy first prioritizes deleting inactive lines. Only if no inactive line is found does it delete the oldest active line.

  • Key Steps:

    • Loop through all lines and check their is_active status.

    • Prefer deleting the oldest inactive line.

    • If no inactive lines are available, delete the oldest active line.

  • When to use:

    • When inactive lines clutter the chart and should be prioritized for removal.

Pros:

  • More efficient for long-term analysis, as it prioritizes active vs. inactive lines.

Cons:

  • Slightly more complex than Strategy 1 due to dual checks.

Garbage Collection Strategies: Prioritized Deletion of Inactive Lines
 

3. Strategy 2: Deleting the Least Relevant Line (Distance-Based)

  • Logic:

    • Find and delete the line that is the furthest away from the current bar, regardless of whether it is active or inactive.

  • Key Steps:

    • Calculate the bar_distance from the current price.

    • Identify the least relevant line (with the maximum distance).

    • Delete it.

  • When to use:

    • If the priority is purely on proximity to the current bar and relevance is based on time.

Pros:

  • Effective in ensuring that lines closest to current price action are maintained.

Cons:

  • Active lines that are far back in history may be deleted.

Garbage Collection: Deleting the Least Relevant Line (Distance-Based)

4. FIFO (First In, First Out) Strategy: Simple Line Deletion

  • Logic:

    • Use a FIFO approach by deleting the oldest line first without evaluating its relevance.

  • Key Steps:

    • Use array.shift() to remove the oldest line and its corresponding data.

    • Continue the process until enough lines are cleared.

  • When to use:

    • When performance is crucial and you want the fastest way to free space.

Pros:

  • Extremely fast and efficient with minimal overhead.

Cons:

  • Doesn’t evaluate whether the line is active or relevant, so important lines may be removed.

Garbage Collection: Simple Line Deletion

Garbage Collection Comparison Table

StrategyPrioritySpeedAccuracy

When to Use

1. Oldest Line Deletion

Oldest line based on time (global view)

Medium

High

When precision in targeting irrelevant lines is required.

2. Prioritized Deletion

Inactive lines first, then oldest active

Medium

High

When inactive lines should be cleared first to declutter.

3. Distance-Based

Furthest from current price

Medium

High

When maintaining lines closer to the current bar is essential.

4. FIFO Strategy

Oldest line first (no evaluation)

Fast

Low

When quick cleanup is needed, and precision isn’t important.

Recommendation:

  • Use Strategy 1b or Strategy 3 when accuracy and relevance are key.

  • Use Strategy 4 (FIFO) for maximum speed and minimal processing delay.

  • Experiment with these strategies to determine which best fits your trading and charting needs!

Â