Getting Started

Syntax

FAQ

No-code Alert

No-code Alert

Automating Scripts without Code Access

If you don't have access to a script's code, you may still be able to automate the strategy or indicator if it passes one of the three feasibility tests outlined below.

icon
If you do have access to the script's code in TradingView, please refer to the Low-Code guide instead.

Testing Script Automation Feasibility

To determine if a script can be automated without code access, conduct the following tests in order:

Test 1: Checking for Strategy Scripts

  1. Apply the script to your chart and create an alert (Alt+A on Windows / Option+A on Mac).
  2. Under "Condition", select the strategy you want to automate and choose "Order fills only". Show Image
  3. If you can select "Order fills only", the strategy script is likely automatable. Proceed to the Strategy Implementation section.

Test 2: Checking for alert()

  1. Attach the script to your chart and click "Settings" on the script's name in the top left corner.
  2. image
  3. In the pop-up window, select "Inputs".
  4. icon
    If you don't see "Inputs", the script fails Test 2. Proceed to Test 3.
    image
  5. Look for "License ID" or similar in the input options.
  6. icon
    If "License ID" is present, the script may be automated using alert(). Proceed to the alert() Implementation section.
    icon
    If no "License ID" input exists, the script fails Test 2. Proceed to Test 3.

Test 3: Checking for alertcondition()

  1. With the script on your chart, create an alert (Alt+A on Windows / Option+A on Mac).
  2. Under "Condition", select the script.
  3. image
  4. Look for options like "Going Long" or "Going Short" above the "Crossing" field.
  5. icon
    The script author may use different naming conventions here.
    icon
    If options exist above "Crossing", the script may be automated using alertcondition(). Proceed to the alertcondition() Implementation section.
    icon
    If no options appear above "Crossing", the script fails Test 3 and cannot be automated without code access.
    image

If All Tests Fail

If the script fails all three tests, it cannot be automated without the author adding required code. You can ask the author to make it PineConnector-compatible using these instructions.

Implementing Automated Scripts

Follow the steps below to implement scripts that passed the feasibility tests.

Strategy() Implementation

For scripts that passed Test 1:

  1. Apply the strategy script to your desired chart and timeframe.
  2. Create a new alert (Alt+A on Windows / Option+A on Mac) and select the strategy under "Condition".
  3. Choose "Order fills only" to ensure the alert only triggers on actual order executions. Show Image
  4. Configure the alert message to define the trading parameters. Use a basic format like:For more dynamic strategy alerts, utilize placeholders:
  5. LicenseID,buy,{{ticker}},risk=1
    LicenseID,buy,{{ticker}},risk=1,sl=10,tp=20
    💡
    Customize the values for risk, stop loss (sl), take profit (tp), and other parameters as needed.
    LicenseID,{{strategy.order.action}},{{ticker}},risk={{strategy.order.contracts}}
    💡
    Placeholder Options You may see the entire list of Placeholders here for both indicators and strategies. The following are some popular placeholders:
    • {{ticker}} → returns the ticker of the symbol used in alert (EURUSd, BTCUSD, etc.)
    • {{strategy.position_size}} → returns the size of the current position.
    • {{strategy.order.action}} → returns the string “buy” or “sell” for the executed order.
    • {{strategy.order.contracts}} → returns the number of contracts of the executed order.
    • {{strategy.market_position_size}} → returns the size of the current position as an absolute value, i.e. a non-negative number.
  6. Save the alert and wait for it to trigger based on the strategy's conditions.
    1. Triggered alerts will send the configured message, which PineConnector will use to execute the defined trades.
  7. Monitor your positions and manage your trades according to your plan.
    1. You can pause or edit the alert as needed from the TradingView Alerts panel.
  8. Repeat the process to automate the strategy on additional symbols and timeframes.
    1. Each alert operates independently, so make sure to set up alerts for all desired symbols and timeframes.

alert() Implementation

For scripts that passed Test 2:

  1. Update the script's input settings, such as License ID, Stop Loss, Risk, etc. The available options may vary. Click "Ok" to save changes.
  2. image
  3. Navigate to the desired symbol and timeframe, then create an alert.
  4. Select the script under "Condition" and enter this Webhook URL:
  5. For PineConnector v2:
    https://pineconnector.net/webhook/
    
    For PineConnector v3:
    https://webhook.pineconnector.com
    image
  6. The created alert will display the symbol and timeframe it's running on.
  7. image
  8. Triggered alerts, along with inputted settings, will appear in the Alerts log.
  9. Repeat this process for any additional symbols and timeframes you wish to automate.

alertcondition() Implementation

For scripts that passed Test 3:

  1. Create an alert and select the appropriate script and option under "Condition".
  2. icon
    The script and long/short options may have custom names set by the author.
    image
  3. Under "Options", select "Once Per Bar Close" to minimize repainting issues.
  4. Configure the alert message based on whether the script is a strategy or indicator:
  5. For basic alerts:

    LicenseID,buy,{{ticker}},risk=1
    LicenseID,buy,{{ticker}},risk=1,sl=10,tp=20

    For strategy scripts:

    LicenseID,{{strategy.order.action}},{{ticker}},risk={{strategy.order.contracts}}
    icon
    Review available placeholder options for strategies and indicators.

    Some commonly used placeholders:

    • {{ticker}} → the alert's symbol (EURUSD, BTCUSD, etc.)
    • {{strategy.position_size}} → current position size
    • {{strategy.order.action}} → "buy" or "sell" for executed order
    • {{strategy.order.contracts}} → number of contracts in executed order
    • {{strategy.market_position_size}} → current position size as an absolute (non-negative) value
    image
  6. If an alert triggers, you can pause the active alert.
  7. image
  8. Triggered alerts will display {{strategy.order.action}} for indicator scripts or actual actions like "buy"/"sell" for strategy scripts.
  9. Repeat this setup for any additional symbols and timeframes to automate.
icon
Make sure your alert message follows the required PineConnector syntax.
icon
Replace "LicenseID" in the message with your actual PineConnector License ID from your licensing dashboard. It should be a long string beginning with "6".

Feel free to reach out if you have any other questions! Happy automating!