2️⃣How to use TradeSmart PREMIUM scripts with PineConnector?

PineConnector is our go-to tool when talking about automated Forex trading. Here, you will learn how you can Pineconnector with TradeSmart PREMIUM Strategies.

If you have any issues during the process, you can always check out PineConnector's Errors and Solutions page.

Step 1

Ensure that you are Using a Compatible Operating System.

PineConnector is compatible with the following Operating Systems:

  • MacOS

  • Windows 10 and 11

  • Windows Server 2016, 2019 and 2022

Step 2

First, you need to register for PineConnector.

Step 3

Once you are logged in click the "Members Portal" button in the top right corner.

Step 4

Next, click the MT5 button, this downloads the PineconnectorEA file that you will have to use later in Step 6.

Also save your preassigned License ID, you will need this in Step 10.

Step 5

If you do not have Metatrader5 installed, click the link here, and download the one fitting your operating system, or follow the instructions of your broker.

Step 6

Once Metatrader5 is installed open it and click “File”“Open Data Folder”.

Step 7

In your Data Folder, click on “MQL5”.

In your MQL5 folder, click on “Experts”.

In your Experts folder, paste the PineConnector EA that you have downloaded in Step 4.

Step 8

At the top of your MetaTrader 5, click “Tools” → “Options”.

Then click "Expert Advisor" and tick "Allow DLL Imports" and "OK".

Step 9

At the top of your screen, ensure that “Algo Trading” is in green.

Step 10

Open Navigator by pressing “Ctrl+N” → Right click on “Expert Advisors” → Click “Refresh”.

The chart symbol has to be the same as the one you use on Tradingview, otherwise the strategy won't work.

Right click on the PineConnector MT5 EA and click “Attach to Chart”.

Under the "Common" tab, tick “Allow Algo Trading”.

Under "Dependencies", tick “Allow DLL imports”.

Under "Inputs", add your Pineconnector License ID, which you saved Step 4, then click "OK".

Here you can also set the volume type, which is the has the following options:

  1. Lots

    1. Indicating "risk=1" will mean 1 volume/lot will be opened

  2. Dollar Amount

    1. The amount that you will lose if your trade hits the specified SL

    2. If you have an EURUSD trade with 15 pip SL with $1000, risk=1 with this Volume Type will mean that hitting the SL you will lose $10

  3. Percentage of Balance, Lots

    1. Using “risk=1”,

      1. 0.1 lot will open on a $1000 account

      2. 1 lot will open on a $10,000 account

      3. 10 lots will open on a $100,000 account

    2. sl= syntax is not required

  4. Percentage of Balance, Margin

    1. If you set "risk=1" on a $1000 account, it means that opening a position will increase the margin by 1% or $10

  5. Percentage of Balance, Loss

    1. Using “risk=1” on a $1000 account translates to you losing 1% or $10 if you were to hit SL

    2. sl= syntax is required

    3. Position size will be computed automatically based on the SL specified

If you did everything correctly, you should see the following screen with the “Successfully connected to PineConnector’s Server” text.

Step 11

Next open up Tradingview in a new window and one of our PREMIUM scripts to the chart you would like to use.

Click the Strategy Settings and scroll down to the bottom, to the Automation part.

Tick the "Use Automation" box.

Here you can insert PineConnector's Syntax:

Components

  • License ID: unique identifier found in the Licensing Dashboard (from Step 4)

  • Commands: actions like “buy”, “sell”, etc. (no equal (=) sign)

  • Symbol: asset or instrument to be traded

  • Others: additional components with equal (=) sign such as “risk=”

For the exact syntax and rules check out PineConnector's Syntax Guides.

Structure

  1. The syntax must follow this order: LicenseID, Command, Symbol, Others

  2. Components must be separated by commas (,) with no spaces

  3. Each alert can only have one License ID, Command, and Symbol.

Acceptable PineConnector Syntax

LicenseID,Command,Symbol,OthersCopy 

Unacceptable PineConnector Syntax

1. Command,LicenseID,Symbol (incorrect order)
2. LicenseID,Command,Command (multiple Commands)
3. LicenseID,LicenseID,Command,Symbol (multiple LicenseIDs)

Here is an example setup for our PREMIUM scripts:

ENTER LONG ALERT: 111111111,buy,EURUSD,risk=1,comment="MyStrategy1"

ENTER SHORT ALERT: 111111111,sell,EURUSD,risk=1,comment="MyStrategy1"

EXIT LONG ALERT: 111111111,closelong,EURUSD,comment="MyStrategy1"

EXIT SHORT ALERT: 111111111,closeshort,EURUSD,comment="MyStrategy1"

In this case our License ID is "111111111".

If you want to enter long trade you should use "buy" command, in case of short you should use "sell" command.

To exit trades it is recommended to use "closelong" in case of long position and "closeshort" in case of short position, this will close all long and short positions.

Here I use the "EURUSD" Symbol as I will be using it's chart in Step 12.

In this example risk equals "1" this means that you will be trading 1 "piece" of the asset, here piece refers to to volume type you set in Step 10. This can be a percentage, dollar amount etc.

Comment is not required, although it is a very useful tool. This way, you can add a name to your strategy, which serves as a unique identifier. If you have two different strategies running, for example, on EURUSD, you should name them differently to avoid potential interference with alerts.

There are many other settings you can use to get the best results, for further instructions check out PineConnector's Syntax Guides.

When you finished, it should look something like this:

Step 12

Next in the top right corner click "Alerts" and then "Create Alert".

For Condition select the ATR GOD Strategy, you can add a name to the alert, and for the message set the following:

{{strategy.order.comment}}

Next click "Notifications", tick "Webhook URL" and set the text to the following:

https://pineconnector.net/webhook/

Then click "Create"

Congratulations! You now have a running script!

Last updated