Representing time and date in Pine Script can be problematic, especially for not-so-experienced developers. The output format for date/time may not make a lot of sense. As an illustration, let’s try to plot the date/time on your screen using the following code. You should get something like this: This happens because date and time are How to Add / Subtract Time in Pine Script Read More →
You may sometimes need to display an indicator on top of the price chart (for instance, when you want to compare patterns in the indicator with the price). Issues may however occur with the price chart if the scale of your indicator is vastly different from the price scale. TradingView will try to display both How to Plot an Indicator on Top of Price Chart With Separate Scale? Read More →
This method doesn’t seem to work anymore, check the following article: Exporting New TradingView Trades metrics to Excel In one of my previous posts, I detailed how it is possible to export strategy backtesting data (but only a Pro+ or Premium TradingView account). If you are a trader/user who only has a free TradingView account, How to Export TradingView Backtesting Data With a Free Account Read More →
You may want to export TradingView strategy backtesting data for any number of reasons. For instance, you could want to use data in other programming languages or analyze this data in Excel or analytics tools. The good news is that TradingView recently introduced a feature to make this process super easy for you. Keep in How to Export TradingView Backtesting Data From a Pro Account Read More →
There are multiple libraries that you can use to backtest a strategy in Python. However, I often use Backtrader because it is a nice open-source framework that allows me to quickly test historical data, optimize strategies, and create visual plots. Backtrader comes across as being really flexible and quite easy to use – which makes How to write your first, simple backtrader strategy Read More →
Order placement commands are quite important to your TradingView strategy. But many people are surprised by the default behavior of PineScript when it executes market orders. Sample Strategy For an illustration, the Pine Script code below highlights a super simple strategy. In this strategy, we enter and exit long positions using market orders. We also How to Enter/Exit Positions on Bar Close in Pine Script Strategies Read More →