Horizon Trading
  • Welcome to Horizon AI
  • After Sign Up
    • Connecting your Discord
    • Download the Chrome Extension
  • HorizonAI Chat
    • Introduction
    • Horizon Chat Best Practices
    • Features
      • Connecting to the Pine Editor
      • Chat Commands
      • Quick add Scripts
      • Starting a New Project
    • Examples
      • Advanced Order Blocks w/ Volume
  • Script Builder
    • What is the Script Builder
    • Blocks
      • Indicators
      • Day and Time
      • Candle Patterns
      • Conditions
      • Open/Closing a Trade
    • Building your first script
    • Script Templates
      • Making an EMA Crossover
      • Higher TimeFrame Supertrend
      • Order Block Retest w/ Market Structure
      • Trend Line Breakout in a Trending Market
      • Break of Structure during London Open
Powered by GitBook
On this page
  • How it works:
  • Connecting Condition Blocks
  • Conditions Output
  • Using Multiple Condition Blocks
  • Using Condition Blocks:
  1. Script Builder
  2. Blocks

Conditions

What are Condition Blocks are how to use them

PreviousCandle PatternsNextOpen/Closing a Trade

Last updated 7 months ago

The Condition Block is a tool in the script builder that allows you to create trading logic by comparing different values in your trading strategy. It's used to make decisions based on specific market conditions or indicator values.

How it works:

  • Setting Up a Condition: When you add a Condition Block to your strategy, you'll see three main components:

  • Line 1: The first value you want to compare

  • Condition: The type of comparison you want to make

  • Line 2: The second value you're comparing against

Connecting Condition Blocks

When Condition Blocks are connected to Tool Blocks such a: Indicators, Day and Time and Candle Patterns. The Condition Blocks will update, and show options that are available to that tool.

For Example: If we connect a Simple Moving Average (SMA) Indicator Block to a Condition Block, we will be able to create conditions for the SMA

For Example: If we connect a MACD Indicator Block to a Condition Block, we will be able to create conditions for the MACDs available outputs

Conditions Output

The Condition Block outputs a True or False value based on whether the condition is met. This can be used by other blocks in your strategy to trigger actions, such as buying or selling

Green Connection Dot: If the Condition is TRUE it will continue to run the blocks connected to the Green Dot.

Red Connection Dot: If the Condition is FALSE it will continue to run the blocks connected to the Red Dot.

Using Multiple Condition Blocks

You can use multiple Condition Blocks to stack different conditions.

In this example, our first Condition Block checks to see if the current Close is above the SMA. If this is true, we then use a second Condition Block to check to see if a Morning Start Candle Pattern is present. If both of these Conditions are TRUE, we send a BUY

Using Condition Blocks:

  • Entry/Exit Signals: Use conditions to determine when to enter or exit trades. For example, "When Fast MA crosses above Slow MA".

  • Trend Identification: Create conditions that help identify market trends, like "When price is above 200-day moving average".

  • Indicator Thresholds: Set up conditions based on indicator values, such as "When RSI is above 70".

  • Complex Logic: Combine multiple Condition Blocks to create more sophisticated trading rules.

Remember, Condition Blocks are the decision-makers in your strategy. They take the data from your indicators and market information and turn them into actionable signals. Experiment with different conditions to fine-tune your strategy's performance.

Condition Block
Condition Block Comparison Options
Condition Block with no connections
Condition Block connected to a SMA
Condition Block connected to a MACD indicator showing MACD output options
We BUY if the Condition "Close Crosses Above the SMA"
Using 2 Condition Blocks to check for a Morning Start Pattern above a SMA