buddhasmiles
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: November 16th, 2020
Contact: TradingView Profile

Fetching stocks matching a strategy

Team ,

Greetings from India.

i have a query regarding pine script.

am not sure whether i can implement this with pine script, please advice me .

i have a strategy developed with RSI and ADX, it should return me (alert) the stock(not all i will be mentioning the stocks name in an array) which matches these conditions.

lets say every 5 minutes these condition needs to be checked and return me all stocks

is this possible with pine script ??

Thanks
jeebu

User avatar
Matthew
Site Admin
Site Admin
Posts: 92
Joined: July 1st, 2020
Location: Australia
Contact: Website Facebook Twitter TradingView Profile

Re: Fetching stocks matching a strategy

Unfortunately no :(

I would love this feature too but Pine Script doesn't currently allow it. You can maybe use the Stock Screener to achieve this but it's not automated.

Hopefully one day soon the TradingView team will allow us to run our scripts through the market screener, but for now you can only run your scripts on each market you have loaded onto your chart. So you must manually cycle through each stock. It sucks, I know :(

mastermind007
Pine Script Rookie
Pine Script Rookie
Posts: 2
Joined: March 31st, 2021

Re: Fetching stocks matching a strategy

Convert your strategy into a function which returns boolean
customFunc() =>
boolVal = close > open
[close, boolVal]


[vl01, ln01] = security("TATASTEEL", timeframe.period, customFunc ())
...... // few more such scripts
[vl20, ln20] = security("ACC", timeframe.period, customFunc ())

//create label to see the names of matching stocks

Return to “Pine Script Q&A”