Intro to my python-tradingview strategy

83
After three years working on multiple trading strategies, I decided to share my experience and my trades. But before going live, I think I need to explain the roadmap I’ve followed so far.

I initially started coding my strategy in PineScript, which is a powerful tool. It allowed me to simply code my ideas and turn them into trading signals using alerts and conditions. I’m sure you’ve already watched dozens of YouTube videos on how to use webhooks and TradingView to send signals to your trading platform. Anyway, I began developing my strategy in Pine and used webhooks to connect to Tradovate. I went live after a few months of testing—which, of course, was my first mistake. In January 2022, my algo went live. I traded on a strategy that was just tuned on seen data, manually flipping parameters to maximize PnL—a purely overfit model—and I went live with real money. Anyway, the first month was positive and I thought I was the best trader in the world. I even told my wife we were going to be rich, like nothing could stop us. But after three months of trading, I lost—obviously. It was a bummer, but I knew where the problem was: lack of proper backtesting.

So that was the moment I moved my code to Python. It took me a couple of weeks to build an end-to-end backtesting framework in Python. I used Backtrader as a backtesting tool, which is awesome. I’ll have some videos soon to explain more about that. Anyway, moving my code to Python gave me the luxury of backtesting and creating rolling walk-forward optimizations, allowing me not only to refine my strategies but also to test them on 5–6 years of historical data.

Long story short, working with Python enabled me to come up with five different strategies for NQ and ES. I plan to share those trades, but before that, I thought I should share my journey first.

Please leave comments and follow my channel. More to come.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.