OPEN-SOURCE SCRIPT

DrNon Supertrend Strategy With Date Filter

How This Works
1. User Inputs for Date Range
• You specify a Start Date (Year, Month, Day) and an End Date (Year, Month, Day).
2. Create Timestamps
• startTime and endTime define the exact Unix timestamps for when you want the strategy to begin and stop taking trades.
3. Filtering Condition
• inDateRange is true only if the current bar’s time lies between startTime and endTime.
4. Conditional Trading
• The trading logic (entries) executes only if inDateRange is true.
5. Supertrend Logic
• Pine Script’s ta.supertrend() returns [value, direction].
• We monitor ta.change(direction) to detect switching signals for Long or Short.
Trend Analysis

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?


更多:

免责声明