NocodeAlert (26/3/24)

NocodeAlert (26/3/24)

No-Code Alert

If you do not have access to the script’s code, you might still be able to automate the strategy or indicator if it passes either of the 2 feasibility tests.

💡
There is also a possibility that the coder did not add alert codes. In this case, you will not be able to automate the script.
💡
If you have access to the code in the TradingView indicator or strategy, refer to the Low-Code guide.

Let’s check if the script-owner added the alert codes by doing the Feasibility Test.

1. Feasibility Test

Let’s try to determine whether the script can be automated — without access to the code.

💡
Failing both Feasibility Tests? If the script you intended to automate failed both feasibility tests, you will not be able to automate the strategy or indicator unless the script-owner injects some code. Request for Code-Injection You may contact the script-owner to make it PineConnector-compatible by sending them this link.

1.1 alert()

Ensure you have attached the With the script attach to your chart, on the top left corner hover on it and click “Settings”.

image

You will see a pop-up.

💡
No Input, No Pass If you do not see “Inputs” in the pop-up, the script failed Feasibility Test 1. Try Feasibility Test 2.

Select “Inputs”.

image
💡
No License ID, No Pass If you do not see License ID in inputs, the script failed the Feasibility Test 1. Try Feasibility Test 2.
💡
License ID input exists If you see something like License ID or PineConnector License ID, you might be able to automate the script. Refer to the alert()’s No-Code implementation here.

1.2 alertcondition()

With the script applied to the chart, create an alert (Alt+A on Windows or Option+A on Mac), under “Condition” select the script.

image

If you have options above “Crossing” such as “Going Long” and “Going Short”, you might be able to implement the script.

💡
Different name? No worry. The script-owner would have named the script something other than “EMA”, and the possible options other than “Going Long” and “Going Short”.
💡
Nothing above “crossing”?

If you see no entry above “crossing” such as the screenshot below, the script fails the Feasibility Test 2.

image
💡
Something above “crossing”? If you see something above the “crossing” condition, you might be able to automate the script. Refer to the alertconditon()’s No-Code implementation here.

1.3 Strategy

With the script applied to the chart, create an alert (Alt+A on Windows or Option+A).

Select the Strategy you’re looking to implement under “Condition”, and select “Order fills only”.

image

If you are able to select “Order fills only”, you should be able to automate the strategy by tweaking the Message.

You may start with something basic:

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

If your script is a strategy, you may opt for something more dynamic:

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.

2. Implementation

💡
If your script passed Feasibility Test 1, refer to 2.1. If your script passed Feasibility Test 2, refer to 2.2.

2.1 alert()

If you see a License ID input in the script’s settings, you should be able to automate the script easily.

image

2.1.1 Update Inputs

To implement the script, simply tweak the inputs available such as the License ID, Stop Loss and Risk. The script-owner might have a different set of input options — perhaps with traildist or the spread filter.

image

Select “Ok” once you have completed your edit.

2.1.2 Create Alerts

Go to the symbol and timeframe you’d like to implement the script for and create an alert.

Select the appropriate script under Condition, and input the following Webhook URL:

https://webhook.pineconnector.com

In this example, we are implementing the script on US100 — evident from the “Create Alert on US100” at the top.

image

Once you have created your alert, you will be able to see the ticker and timeframe the alert is running on.

In this example, the alert is running based on prices on US100 on the 1 second chart.

image

The fired alert can be seen in the Alerts log, taking on the inputs you have indicated such as the License ID and post-symbol identifier.

You may repeat the implementation if you’d like to trade more symbols and timeframes.

2.2 alertcondition()

The script-owner might have used alertcondtion() to create the alert function.

2.2.1 Create Alerts

For this scenario, select the script under “Condition” and the appropriate selection such as “Going Long”.

💡
It’s just a name Your script will likely be named something other than “EMA”, and the long alerts may be “buy” or “strategy buy” instead.
image

Under Options, we recommend you select “Once Per Bar Close” to reduce repainting issues.

💡
Strategy vs Indicator The script you are using might be a strategy or an indicator. For this test, we used the 5 second chart to trigger the alert as soon as possible — you may use the 1 minute chart if you are on TradingView Pro or Pro+.
LicenseID,{{strategy.order.action}},{{ticker}},risk=1

Putting the alert setup panel together, we have something like this:

image

Once an alert fires, you may pause the active alert.

image

If you see {{strategy.order.action}} printed, the script is an indicator.

If you see actual order action such as “buy” or “sell” printed, the script is a strategy.

2.2.2. Configure Alert Message

You may start with something basic:

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

If your script is a strategy, you may opt for something more dynamic:

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.
💡
Syntax Matters Ensure that your alert message is compliant to PineConnector’s messaging structure or syntax here. Update “LicenseID” Please update “LicenseID” to your actual PineConnector License ID found in the licensing dashboard — it’s a long value beginning with a 6.

You may repeat the implementation if you’d like to trade more symbols and timeframes.