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
  1. Script Builder
  2. Script Templates

Making an EMA Crossover

Making an EMA Crossover

PreviousScript TemplatesNextHigher TimeFrame Supertrend

Last updated 7 months ago

This guide will walk you through setting up a simple EMA (Exponential Moving Average) crossover strategy using two Indicator Blocks.

Steps:

Drag an Indicator Block onto the canvas

  1. Select EMA as your Indicator

  2. Set the Indicator settings for the EMA

  3. Save the Indicator

Drag and Drop a Second Indicator Block

  1. Select "Exponential Moving Average (EMA)" from the dropdown.

  2. Set the period to 200 (for a slow EMA).

  3. Save the settings.

Add a Condition Block

  1. Drag a Condition Block onto the canvas.

  2. Connect both EMA Indicator Blocks to this Condition Block.

  3. For "Line 1", select the output from the 50 EMA.

  4. For "Condition", choose "Crosses Above".

  5. For "Line 2", select the output from the 200 EMA.

  6. Save the settings.

Add Open Trade and Close Trade Blocks

  1. Drag an Open Trade Block onto the canvas and connect it to the Condition Block.

  2. Configure it to "Buy" when the condition is met (Green Dot Connection).

  3. This will "Buy" when the EMAs crossover (bullish)

Compile Your Strategy

  • Click the "Compile" button to generate the code for your strategy.

This strategy will execute a buy when the fast EMA (50) crosses above the slow EMA (200). You can add more conditions or modify the strategy as needed.

Creating an EMA Indicator
Two Indicator Blocks saved on the canvas
Connecting 2 EMA Blocks to a Condition Block