Skip to content

Add docs on choosing data and bars processing #2195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 8, 2025

Conversation

stefansimik
Copy link
Contributor

@stefansimik stefansimik commented Jan 8, 2025

Docs were update on both topics - as I promised.

  • Docs updated: Choosing data: Cost vs. Accuracy
  • Docs updated: Order of OHLC in bar processing

Copy link
Member

@cjdsellers cjdsellers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many thanks 👌 I'll do some formatting and make tweaks once on develop branch.

:::tip
For some trading strategies, it can be practical to start development with bar data to validate core trading ideas.
If the strategy looks promising, but is more sensitive to precise execution timing (e.g., requires fills at specific prices
between OHLC levels, or uses tight take-profit/stop-loss levels), you can then invest in higher granularity data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well stated.

@cjdsellers cjdsellers changed the title Docs updated - Choosing data + Order of OHLC processing in bars Add docs on choosing data and bars processing Jan 8, 2025
@cjdsellers cjdsellers merged commit cafd5ae into nautechsystems:develop Jan 8, 2025
12 checks passed
- Uses bar structure to estimate likely price path:
- If Open is closer to High: processes as `Open → High → Low → Close`
- If Open is closer to Low: processes as `Open → Low → High → Close`
- Testing shows this approach achieves 75-85% accuracy in predicting correct High/Low sequence (compared to statistical 50% accuracy with fixed ordering)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we start quoting research and stats, it might be worth adding some citations if possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhm, good point - reality is - it is my own script, testing 1-year of data with this heuristics:

Current fixed OHLC approach = 50% correct

  • 50% correct simulations
  • 50% incorrect simulations

Proposed heuristic approach = 85% correct

  • 70% of bars have significant directional bias (>35% of bar range difference between open-close)
  • Remaining 30% split roughly 50/50
  • Net result: ~85% accurate simulations (70% + half of the remaining 30%)
  • Only ~15% potentially incorrect simulations

image

If you are OK with it, I can formulate the reasoning behind and add it to the note of these docs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that's great - even if we link to a gist or markdown you can provide for the above 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am making a note and it will be added tommorrow 👍

Pushkarm029 pushed a commit to Pushkarm029/nautilus_trader that referenced this pull request Jan 15, 2025
- Order of OHLC in bar processing
- Choosing data: cost vs. accuracy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants