How often does price actually reach your target before it hits your stop, broken down by time of day? This free Python tool answers that from your own historical minute data. Full source, no signup, change anything you want.
Get it free: https://algocoach.com/tools
NEVER SET UP PYTHON BEFORE? Watch this first or you’ll hit a missing module error: [https://youtu.be/r_VRKh16vDY
━━━━━━━━━━━━━━━━━━━━━━━━
WHAT THIS TOOL DOES
You pick a target distance and a stop distance. It scans your minute history and reports, for every 15 minute slot in the trading day, how often price travelled your target before it travelled your stop. It outputs a heat map, per-combination charts, a directional long vs short breakdown, and a plain text summary.
In this video it ran 150,000 potential trades across 1,700 unique days of NASDAQ minute data.
WHAT IT IS NOT
It is not a strategy, a signal, an indicator, or an entry system. It does not backtest anything. It measures how price behaved historically after a given time of day, and historical behavior is not a forecast. It knows nothing about spread, slippage, commission, or news.
READ THIS BEFORE YOU TRUST A NUMBER
All times are BROKER SERVER TIME, not your local time. On my broker 15: 30 server time is 8: 30am Eastern. Yours may be offset by hours. Check your platform’s market watch clock first or every conclusion you draw will be wrong.
The sample file in the repo is three months of data, which is enough to prove the script runs and not enough to conclude anything from. The results in this video use a much longer private dataset. Use your own longer history for anything real.
━━━━━━━━━━━━━━━━━━━━━━━━
TO RUN IT
python -m venv .venv
.venvScriptsActivate.ps1
pip install -r requirements.txt
python Best_Times_to_Initiate_a_Trade_Checker_1_1.py
Full setup walkthrough: https://youtu.be/r_VRKh16vDY
WHERE TO GET MORE DATA
Your own broker’s MT4/5 platform. Free, and it’s the right data for this tool since output is in broker server time.
Dukascopy historical data. Free, covers indices as well as forex.
TickDataSuite. Paid, 14 day trial. This is what I use.
━━━━━━━━━━━━━━━━━━━━━━━━
TIMESTAMPS
00: 00 The question nobody answers with actual data
00: 22 The setup you need first
00: 47 Reading the code before you run it
00: 57 The data file
01: 16 Do this first or you get a missing module error
01: 26 Why the script takes a while
01: 40 150,000 trades across 1,700 unique days
01: 56 The heat map
02: 18 The 8 hour interval setting
02: 29 Which hours actually performed better
02: 46 How to think about what this is telling you
03: 04 The 28 target and stop combinations
03: 35 The summary, and what it does NOT tell you
04: 01 Directional breakdown: longs vs shorts
04: 21 The best entry times in this sample
04: 38 Why 15: 30 matters (high impact US news)
05: 23 16: 15, and the NASDAQ open
05: 31 Saving your results before the next run
05: 43 Editing the target and stop ranges
06: 14 Where to get it
━━━━━━━━━━━━━━━━━━━━━━━━
KNOWN LIMITATIONS IN v1.1
I would rather tell you these than have you find them the hard way. Full detail in the repo README.
1. Fixed point targets are not comparable across long samples. Run seven years of an index that tripled and a fixed target that was big in year one is small in year seven.
2. The performance score only counts the wins. Read the raw counts, not the score.
3. Slots with very few observations rank highly on noise alone. Check the count column.
4. Your broker’s daily break shows up as missing data.
Percentage and volatility normalized targets are planned.
━━━━━━━━━━━━━━━━━━━━━━━━
MIT licensed. Use it, change it, ship it. New builds weekly, subscribe and you’ll catch them.
#algotrading #python #daytrading
━━━━━━━━━━━━━━━━━━━━━━━━
DISCLAIMER
This video and the tool referenced are for educational and informational purposes only. I am not a financial advisor, and nothing here is financial, investment, or trading advice. Trading forex, futures, indices, and CFDs carries a substantial risk of loss and is not suitable for everyone. My results are my own and do not guarantee or predict your results, and past performance is not indicative of future performance. You are solely responsible for your own trading decisions. FTMO, MetaQuotes, and other referenced brands are the property of their respective owners; references reflect my own experience and do not imply endorsement or affiliation.