# Set Up Guide

{% stepper %}
{% step %}
**Download the CrossTrade Add-On**

Install and connect to CrossTrade
{% endstep %}

{% step %}

#### Create an alert on TradingView

Add your webhook URL and alert message
{% endstep %}

{% step %}

#### Review Alert History <a href="#https-crosstrade.io-user-alert-history" id="https-crosstrade.io-user-alert-history"></a>

Visit crosstrade.io/user/alert-history to review your alerts
{% endstep %}
{% endstepper %}

{% hint style="success" %}
**This video tutorial will walk you through the steps outlined on this page. We recommend reviewing both to ensure you master the Set Up process.** \
\
**You got this! 😎**
{% endhint %}

{% embed url="<https://youtu.be/fRMV66-gZyk>" %}

## <mark style="color:blue;">Step 1 - Download and Install the Add-On</mark>

{% embed url="<https://releases.crosstrade.io/latest.zip>" %}
Click to Download
{% endembed %}

### Install the Add-On

Once downloaded, open NinjaTrader and install the Add-on by clicking on Tools > Import > NinjaScript Add-On.&#x20;

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FqzEuAcTgLo4GmO4Drn0P%2Fimporting-crosstrade-addon-to-ninjatrader.png?alt=media&#x26;token=aa5bd0bc-3113-49d7-8121-91221d4c2b1e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FhMjWp6DDAXY8TOUyi1on%2Fselect-crosstrade-download-and-open.png?alt=media&#x26;token=9fec3b1c-454c-4cd1-afd8-d1a9ae7bacbe" alt=""><figcaption></figcaption></figure>

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FnGGcBhs4ukbHeIP8OLri%2Fclick-yes-to-import-crosstrade.png?alt=media&#x26;token=c8180130-441a-4a18-bd85-e61a8f0d5a52" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Before you restart NinjaTrader, enable the ATI!
{% endhint %}

### Enable the NinjaTrader ATI

Enable the Automated Trading Interface (ATI)  to accept your external commands by going to Tools > Settings > Automated Trading Interface.&#x20;

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FUFabIzx0sfOPJcDZW5Mw%2Ftools-settings.png?alt=media&#x26;token=0d148aa1-1b8b-4966-85df-77ed7a1c5d37" alt=""><figcaption></figcaption></figure>

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FAO8Oq5jm9sKiRpjb9ptt%2Fati-enable.png?alt=media&#x26;token=2bc1d372-3cec-4f80-a12e-ee8c05529be5" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**Now restart NinjaTrader**
{% endhint %}

### Connect to Live Data

In order for your order execution to be supported you need to connect to a live data feed. This can be a purchased data subscription from NinjaTrader directly or a data feed that is provided through a prop evaluation account.&#x20;

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2Fhy2VRds7I8l3xOC2Wtjh%2Fconnect-to-live-data.png?alt=media&#x26;token=2a1c619a-90ee-4cb9-91b2-dcf88a1900c3" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Level 1 data is sufficient for XT orders - Level 2 data is **not** required.&#x20;
{% endhint %}

### Log In to CrossTrade

After you have restarted NinjaTrader, it's now time to *Log In* with your email and password.&#x20;

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2Fv9vQVLnSdqmQcpgkyEDh%2Fninjatrader-start-crosstrade-addon.png?alt=media&#x26;token=ce569b93-209d-45ba-b2bf-6af921ef8791" alt=""><figcaption></figcaption></figure>

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FHT9NVzPQ2ds9YUkiAYgJ%2Fconnect-add-on.png?alt=media&#x26;token=b0c8f305-53f9-4394-aeaa-3964647b92fe" alt=""><figcaption></figcaption></figure>

## <mark style="color:blue;">Step 2 - Create a TradingView Alert</mark>  <a href="#step-2-create-a-tradingview-alert" id="step-2-create-a-tradingview-alert"></a>

To set up an alert, you can utilize various trigger conditions and decide whether the alert should fire once or repeatedly until you disable it. You can customize the alert message to include specific information or values that are relevant at the time the alert is triggered. The notifications for these alerts can be received via pop-ups, emails, and even push notifications if you have the TradingView mobile app installed.

Inside your Supercharts, click to open an Alert window from the top or right navigation clock button

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2F59U1kOBS64j5Ng31ekbC%2Fcreate-alert.png?alt=media&#x26;token=7d3ccd12-26c7-4f7e-93e4-4fd609dc4d16" alt=""><figcaption></figcaption></figure>

### Determine your Alert Conditions

To set up an alert, you can utilize various trigger conditions and decide whether the alert should fire once or repeatedly until you disable it. You can customize the Expiration date of the alert and provide a name to keep your alerts organized.

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FLk18ZeD4H5bkPbrBXiNI%2Falert-condition.png?alt=media&#x26;token=533ae032-b714-4a9e-97ce-0e86ee2c2897" alt=""><figcaption></figcaption></figure>

### Provide payload information

In the message field you will supply the payload information you want to send to CrossTrade for relay to NinjaTrader. You can customize this however you want based on the methods NinjaTrader will accept.

{% hint style="warning" %}
**Remove the default text in the Message window!**&#x20;

ONLY the CrossTrade command can be present. \
\
For example:  Bot V3 (, , , , , , , , , , , , , , , , hlc3, 5, 2, 2.8, 3, 3, 5, 5, 5, 5, NORMAL, 0.75, 0.75, 25, 3, 2, NORMAL, 3, 3, 4, 4, 9, 5, 1, 1.2, 59, 43, 1.55, 23, 2.4, 6.2, CLASSIC, 9, 19, 0.7, 0.25, 0.6, 5, 19, MAC-Z, 6, 67, 25, 17, 2, 0.6, 61, 80, 20, 80, 20, 50, 14, 30, 15, 30, 0.75, 10,000, Small): order {{strategy.order.action}} @ {{strategy.order.contracts}} filled on {{ticker}}. New strategy position is {{strategy.position\_size}}\
\
**All of that needs to be removed.**&#x20;
{% endhint %}

Here is an example of a basic PLACE command for a Buy Market order.&#x20;

```
key=your-crosstrade-secret-key; 
command=place; 
account=sim101; 
instrument=ES1!; 
action=buy; 
qty=1; 
order_type=market; 
tif=day;
```

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FTD8NKGHwr04R0yyJZjVz%2Fmessage-payload.png?alt=media&#x26;token=3e39bd6c-6e6c-489c-a004-e8f0cf8df30b" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you are automating a **strategy** use the following command example with the strategy variables:
{% endhint %}

<pre><code>key=your-crosstrade-secret-key; 
command=place; 
account=sim101;
instrument=ES1!; 
action={{strategy.order.action}}; 
qty={{strategy.order.contracts}}; 
order_type=market; 
tif=day; 
<strong>sync_strategy=true; 
</strong><strong>market_position={{strategy.market_position}}; 
</strong><strong>prev_market_position={{strategy.prev_market_position}}; 
</strong><strong>out_of_sync=flatten;
</strong></code></pre>

{% hint style="info" %}
This command uses Strategy Sync logic and is designed to allow your TradingView strategy to send both entries and exits without interference. If you intend to have NinjaTrader handle the exit logic, you will need to remove the Sync logic (last 4 lines) and add [trade brackets](https://docs.crosstrade.io/webhooks/advanced-options/bracket-orders) or an [ATM strategy.](https://docs.crosstrade.io/ninjatrader/atm-strategies/creating-atm-template)&#x20;
{% endhint %}

### Add Webhook URL

Your webhook URL is found on the Dashboard **and/or** your My Account page

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FVvw12ENKHPk5DOC47sii%2Fwebhook-url.png?alt=media&#x26;token=b9fb5509-fba5-47a5-b04d-5a5e84bcbf76" alt=""><figcaption></figcaption></figure>

Copy the webhook URL from either location to your clipboard...

### **Paste Webhook URL**

On the **Notifications tab** of the alert window, you will need to provide your specific CrossTrade webhook URL. You can also enable alerts for pop-ups, emails, and mobile push notifications if you have the TradingView app installed.

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FA0LmsIOAL400ya2Ybd3h%2Fadd-webhook-url.png?alt=media&#x26;token=a73eea4f-4d11-46db-af3a-d59e26a2a5f7" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
**Webhooks require 2FA to be enabled on your TradingView account. If you have not used webhooks before, you will see this prompt.**&#x20;

<img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FxPVitvUFCIPn7F4T9gst%2Fimage%20(4).webp?alt=media&#x26;token=514dc1de-303e-40da-b8a7-ceb34fe5e55a" alt="" data-size="original">\
\
Once enabled, you can add the webhook URL into the field and save the alert.&#x20;
{% endhint %}

### Managing Alerts on TradingView

You can edit, clone, or delete them from the alert manager, and even adjust alert conditions directly on the chart for easy visualization. Alerts that have been triggered are logged, and you can access and review this log to track past market events and alert responses.&#x20;

{% hint style="warning" %}
Note: TradingView alerts do not dynamically update when you change a condition in your indicator/strategy or chart setting. If you make changes, be sure to update the alert in the Condition dropdown.&#x20;
{% endhint %}

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FWUO4sieFjdXBMmxjraC4%2Fmanaging-alerts-on-tradingview.png?alt=media&#x26;token=e65258b6-146a-4ece-b30d-ab06874ca91c" alt=""><figcaption></figcaption></figure>

## <mark style="color:blue;">Step 3 - Reviewing Alerts on CrossTrade.io</mark>

Once you start sending alerts from TradingView to CrossTrade and NinjaTrader, you can review your recent alert history on the[ CrossTrade Alert History page](https://crosstrade.io/user/alert-history) in your account.&#x20;

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FJqK7W2QUUZo82GAWT2Ca%2Falert-history.png?alt=media&#x26;token=d48a7d71-f400-456b-9e21-50c1543875b7" alt=""><figcaption></figcaption></figure>

Additionally, you're XT Add-on also shows every alert received:

<figure><img src="https://993090024-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI6t5LesvaGZE6r1KML4v%2Fuploads%2FdsDhiCW2kDjuXgHPLZea%2Fadd-on.png?alt=media&#x26;token=f1b71cda-99be-4f81-98ac-fe94c0e59ae3" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Great Job! You are on your way to becoming a CrossTrade master.&#x20;
{% endhint %}
