Page 1 of 1

Fetching stocks matching a strategy

Posted: Mon Nov 16, 2020 9:20 am
by buddhasmiles
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

Re: Fetching stocks matching a strategy

Posted: Thu Dec 10, 2020 4:21 am
by Matthew
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 :(

Re: Fetching stocks matching a strategy

Posted: Wed Mar 31, 2021 8:00 pm
by mastermind007
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