Flexible timezone-aware session rangeAllows you to define session range with local time and its timezone, also can toggle session visibility any day of week.
Session-range
[FN] Session Range & Date Range For BacktestingThis has been done before in different ways, however, my goal is to publish a single, simplified copy/paste version of the idea so you can quickly and easily incorporate it into your strategy backtesting.
You can designate weekdays, weekdays + weekends for 24/7 markets, and also session range.
So, you trade bitcoin? It works. CME futures? It works. You are a discretionary trader so the only signals that matter are the ones that happen when you're awake? It works. Copy and paste.
The goal is that its that easy. You'll have to let me know if it is. glhf everyone.
If I'm not mistaken, you should be able to copy/paste this directly into your strategy script (Paste it in before your entry declarations). Just leave out the last 2 lines where the bgcolor() is declared... unless you want the background color lit up, that's up to you. It's just for demonstration purposes in this script.
After you've pasted it in, then in your strategy.entry() function you are adding: to the strategy.entry() function.
e.g:
strategy.entry("Long", strategy.long, qty=1, when = ENTRY_SIGNAL and signal_backtest())
Shoutouts to @zenandtheartoftrading and @allanster for providing the basis of this code that I put together here. We stand on the shoulders of giants.
Session RangeSimple script for showing the high/low/midrange of a session. By default configured to do the Daily range using the "regular" session. But it's configurable. For example on this chart I am showing the Weekly range.
Sessions on ChartThis script shows the London and NY Sessions on your chart. Decided to publish it on demand for user yuan642 :D. Maybe other users may find it helpful.
Looking back on charts it can help to spot certain moves or patterns around certain Session open when high volumes enter the markets.
[RS]Open Range Breakout V3Request for DCC/coondawg71
added support for using session.
theres a issue with the session it needs to have the format inverted:
(start-end) to (end-start)
'0000-1500' to '1500-0000'