Skip to content

 SuperTrend strategy PineConnector


The famous SuperTrend Strategy is modified to be compatible with PineConnector. The strategy can be used for forex trading, stock trading, futures trading, crypto trading and trading of other instruments.

Nevertheless, we recommend that paper trading should be done first, before running on your live trading accounts. 

With this script, an alert will be automatically trigger and will execute a trade on your MT4/5 terminal when your terminal is connected to our server – ideal if you are day trading or swing trading.

Looking to automate your TradingView strategies while your broker is on MetaTrader?
Try PineConnector for 7 days – credit card not required.

Steps to use this SuperTrend Strategy:
Create a PineScript and attach the code below

strategy('Supertrend Strategy - PineConnector', overlay=true)

LicenseID = 50123456789 // 1. change to your PineConnector License ID (required) 

atrPeriod = input(10, 'ATR Length') // 2. Change the ATR length/period (optional)  
factor = input(3, 'Factor') // 3. Change the ATR factor/multiplier (optional)  
riskvalue =, 'Risk Value') // 4. Change the risk value (optional)  

[supertrend, direction] = ta.supertrend(factor, atrPeriod)

bodyMiddle = plot((open + close) / 2, display=display.none)
upTrend = plot(direction < 0 ? supertrend : na, 'Up Trend',, 0), style=plot.style_linebr)
downTrend = plot(direction < 0 ? na : supertrend, 'Down Trend',, 0), style=plot.style_linebr)

fill(bodyMiddle, upTrend,, 90), fillgaps=false)
fill(bodyMiddle, downTrend,, 90), fillgaps=false)

if ta.change(direction) < 0
    strategy.entry('My Long Entry Id', strategy.long)
    alert(str.tostring(LicenseID)+',buy,' + syminfo.ticker + ',sl=' + str.tostring(supertrend) + ',risk=' + str.tostring(riskvalue), alert.freq_once_per_bar_close)

if ta.change(direction) > 0
    strategy.entry('My Short Entry Id', strategy.short)
    alert(str.tostring(LicenseID)+',sell,' + syminfo.ticker + ',sl=' + str.tostring(supertrend) + ',risk=' + str.tostring(riskvalue), alert.freq_once_per_bar_close)

plotshape(ta.change(direction) < 0, style=shape.labelup, location=location.belowbar,, 0), size=size.large, text='PineConnector \n Buy',, 0))
plotshape(ta.change(direction) > 0, style=shape.labeldown, location=location.abovebar,, 0), size=size.large, text='PineConnector \n Sell',, 0))
Edit the License ID to your preassigned ID found in the PineConnector members area (e.g. 60123456789)
Edit the ATR period & Factor value (Optional)
Save the code, and click "Add to Chart"

Guide to create alerts: Create alerts

● After changing values from (3 or 4), please delete the old alert(s) if any and create a new alert
● Please ensure you select SuperTrend strategy (PineConnector) when creating an alert, and select alert() function calls only

supertrend strategy pineconnector

Recommended EA settings:
Volume Type: Percentage of account balance
● Assuming risk=1 and $1000 account,
the EA will compute the position size whereby when the trade hits SL, you will lose 1% or $10.
Close on reverse: TRUE
● Then open buy position will be closed first followed by the open of a sell, upon receipt of a sell signal - and vice versa


Hello Owner,

My name is ariel and I found your store through a google search last week.

Do you import some of your products or packaging materials from China? Or do you plan to import products from China?

We offer one-stop services for online store sellers, including product sourcing, negotiating, purchasing, quality control, shipping, free warehouse storage, custom packaging and packaging inserts

As your private sourcing agent, we can help you get a better price, build your brand, control the risk and save the time to import from China.

Let me know if you’re interested and I’ll send over some more info.


Shenzhen, China
Whatsapp(Skype): +86 18665815030


What should I put in the message section of the trading view alert for the startegy to trigger the trade

Kostas Kond

Works fine


It works fine, long term on Heiken Ashi candles. Short term I see no chance.


Has anyone set this up with any pairs and come out profitable in any capacity?


Leave a comment

Back To PineConnector Script Library