Algo.Analytics.Python/README.md
This folder contains sample analytics scripts for the StockSharp trading platform written in IronPython. Each script implements the IAnalyticsScript interface and can be executed inside StockSharp Designer or any application that supports analytics scripts.
These examples illustrate the Hydra analytics feature. See the Hydra documentation for usage details.
The examples demonstrate how to analyse market data and visualize the results using StockSharp API. They can be used as a starting point for developing your own analytics tools or trading algorithms in Python.
StockSharp.Algo.AnalyticsAlgo.Analytics.Python/
├── common/ # Helper modules used by the scripts
├── biggest_candle_script.py
├── chart3d_script.py
├── chart_draw_script.py
├── empty_analytics_script.py
├── indicator_script.py
├── normalize_price_script.py
├── pearson_correlation_script.py
├── price_volume_script.py
└── time_volume_script.py
common helpersThe common directory provides a set of helper functions that simplify interaction with StockSharp objects from Python:
TimeFrame values.IStorageRegistry.Below is a brief description of the provided scripts.
empty_analytics_script.pyTemplate demonstrating the minimal implementation of an analytics script. Use it as a starting point for your own logic.
biggest_candle_script.pyFinds the candles with the largest volume and range for each selected security and displays them on separate 3D charts.
chart3d_script.pyAggregates traded volume by hour for several securities and visualizes the results on a 3D chart.
chart_draw_script.pyShows how to draw different series styles (lines and histograms) on charts using closing prices and volumes.
indicator_script.pyCalculates the Rate of Change (ROC) indicator for the loaded candles and plots both the candle series and indicator values.
normalize_price_script.pyNormalizes closing prices of multiple securities to start from 1, allowing them to be compared on the same chart.
pearson_correlation_script.pyLoads closing prices for multiple securities, computes the Pearson correlation matrix using NumPy.NET, and displays the matrix as a heatmap.
price_volume_script.pyCalculates how trading volume is distributed across price levels for a single security and draws the distribution as a histogram.
time_volume_script.pyAnalyses when the largest trading volume occurs by grouping candles by hour and listing the totals in a grid.
PATH..py files and execute the script. Most scripts expect candle data to be available in your storage; adjust the date range and security identifiers as needed.