UnknownUnicorn19826629

Date Range Demonstration

This is a simple strategy that demonstrates how to easily incorporate a date range into a strategy. This allows you to limit your backtesting to a specific range of dates, which is vital if you want to compare different time frames.

To use:
  • Copy the code block between the '////' lines into your strategy.
  • Add the variable 'inDateRange' to your entry and/or exit strategy conditions.
Release Notes:
Added presets for previous 30, 90, and 180 days plus year to date.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

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.

Want to use this script on a chart?