Automate TradingView Strategies Guide

Overview

Lune Auto Trader allows users to automate their TradingView strategies by integrating them with NinjaTrader or Tradovate. Each strategy uses a set of unique alert messages and a webhook to automate trade actions such as entries, exits, and partial exits.

This guide walks you through how to:

  • Add a strategy to an account

  • Link TradingView alerts

  • Use strategy instructions (webhook + alerts)

  • Automate trades using Lune Auto Trader

Prerequisites

Before starting, ensure the following:

  • You have an active Lune Auto Trader license.

  • You have NinjaTrader installed and connected.

  • Your TradingView account is set up and has access to the strategy you want to automate.

  • You’ve downloaded and installed the Lune Auto Trader software.

Step-by-Step Instructions

Step 1: Add a Strategy to Your Account

  1. Launch Lune Auto Trader and ensure your account is connected.

  2. Click Add Account (top of the interface) and configure your NinjaTrader or Tradovate account if not already added.

  3. Click the Config button next to your connected account.

  4. In the configuration window:

    • Click Add Strategy.

    • Set a name (e.g., strat1).

    • Select the instrument (e.g., ES JUN25).

    • Choose how many contracts to trade.

  5. Save your configuration.

How to View NinjaTrader Instruments
  1. Open Control Center.

  2. Click ToolsInstrument List to browse all configured assets.

Step 2: Open Strategy Instructions

  1. In the strategy configuration panel, click the Instructions button.

  2. A window will appear containing:

    • Your unique Webhook URL

    • A list of pre-generated Alert Messages:

      • Long Entry

      • Short Entry

      • Long Exit

      • Short Exit

      • Long Partial Exit

      • Short Partial Exit

  3. Click Copy next to each alert to store it for use in TradingView.

Step 3: Configure Your Strategy on TradingView

  1. Open TradingView and add the strategy you want to automate to your chart.

  2. Click the gear icon (⚙️) to open the strategy settings.

  3. Scroll down to the Alert Configuration section.

  4. Paste the corresponding alert messages into each available field:

    • Entry Long Alert Message

    • Entry Short Alert Message

    • Exit Long Alert Message

    • Exit Short Alert Message

    • Long Partial Exit Alert Message

    • Short Partial Exit Alert Message

  5. Click OK to save your changes.

Step 4: Create Alerts in TradingView

  1. In TradingView, click the Alert (⏰) icon at the top.

  2. Under Condition:

    • Choose alert() function calls only.

  3. Under Notifications:

    • Enable Webhook URL.

    • Paste the Webhook URL from your strategy instructions.

  4. Click Create.

Repeat this process for each alert type if they aren’t bundled in one strategy alert.

Step 5: Finalize Strategy Settings in Lune Auto Trader

In the strategy configuration window in Lune Auto Trader:

  • You can customize advanced options:

    • Max Total Contracts

    • Allow Partial Exits

    • Enable News Trading Filter

    • Enable Holidays Filter

    • Enable Time-Based Filter

    • Exit Positions After Hours

    • Trading Start/End Time

  • Click Save Configuration to store your setup.

  • You can also Load, Delete, or Set as Default.

Security Reminder

🔒 Your alert messages and webhook are sensitive credentials. If shared or leaked, others can execute trades on your behalf.

Always:

  • Keep instructions private

  • Never reuse webhooks across multiple strategies unless required

  • Revoke access if compromised (contact support)

Troubleshooting

No trades are executing

Check alert setup on TradingView. Ensure alert() function is selected.

Webhook not working

Confirm webhook URL is pasted exactly.

Wrong instrument being traded

Double-check instrument field in Lune Auto Trader config.

How to View NinjaTrader Instruments
  1. Open Control Center.

  2. Click ToolsInstrument List to browse all configured assets.

Alerts not triggering

Ensure the strategy conditions are active and alert logic is enabled.

Last updated

Was this helpful?