Mathieu2301 / TradingView-API

📈 Get real-time stocks from TradingView
1.65k stars 359 forks source link

Backtesting a Pine Strategy #68

Closed mtahreemalam closed 2 years ago

mtahreemalam commented 2 years ago

Hello, I have a customized strategy in pinescript. I need to test an like a million different parameters to determine the best combination. I cant do that via TV. For it to be done via your API, will we need to first code it in Java? And how much quicker it will be to test those parameters vs TV? @Mathieu2301

Mathieu2301 commented 2 years ago

Hello,

will we need to first code it in Java?

JavaScript*

You can easily get try many parameters of a strategy and compare performance. I think we can test about 10 combinations per second.

mtahreemalam commented 2 years ago

Would it be possible to code a supertrend strategy in Javascript for you?

Mathieu2301 commented 2 years ago

I don't really understand the point of doing that since we can also get the performances of a pine strategy, but yes it is possible.

mtahreemalam commented 2 years ago

If we can get the performance of pine strategy its perfect. Thats why i asked the question before if we will a strategy in Javascript to optimize its parameters via your API, or will pinescript work. Now that you have mentioned pinescript will work. Can you please tell me will all strategies as available on tradingview will be available via the API or is their a limitation?

Mathieu2301 commented 2 years ago

Can you please tell me will all strategies as available on tradingview will be available via the API or is their a limitation?

At the moment we have not found a Tradingview indicator that does not work with the library.

mtahreemalam commented 2 years ago

Can you please tell me will all strategies as available on tradingview will be available via the API or is their a limitation?

At the moment we have not found a Tradingview indicator that does not work with the library.

Thats great. Can you help me install and run it on my PC?

mtahreemalam commented 2 years ago

Ive installed and ran it. Can you please guide me with the commands, to backtest strategy results with multiple parameters

Mathieu2301 commented 2 years ago

You have many examples in the ./examples repository. I can't help everyone especially for questions that are not related to the library but JavaScript.