Skip to main content

Data Export Overview

The MZpack data export system provides a composable pipeline for exporting indicator values and chart drawing objects to CSV files or the NinjaScript Output panel.

Namespace: MZpack.NT8.Algo

Two Export Scenarios

1. IndicatorExport — Indicator Values

Exports calculated values from MZpack indicators (footprint metrics, volume profile levels, delta, etc.) to CSV. Each row represents a bar, with columns defined by a DataSchema.

2. DrawingObjectsExport — Chart Drawing Objects

Exports chart annotations (arrows, text, dots, etc.) placed by strategies. Each drawing object is mapped to a numeric value via a ChartObjectDescriptor, enabling signal labeling for analysis or machine learning.

Architecture

Pipeline
├── IndicatorExport (indicator values → CSV)
│ ├── ExportedIndicator (data source)
│ └── DataSet (rows of values)
│ └── DataSchema (column definitions)
│ └── ValueDescriptor[]

└── DrawingObjectsExport (drawing objects → CSV)
├── ChartObjectDescriptor (object → value mapping)
└── DataSet
└── DataSchema

Pipeline

Pipeline is the central orchestrator. It chains one or more IndicatorExport instances and drives per-bar export across all of them. Adjacent exports are linked via PipelinePrior / PipelineNext for synchronized processing.

var args = new ExportArgs
{
FileName = "ES_footprint.csv",
IsHeader = true,
IsTime = true
};

var pipeline = new Pipeline(strategy, args);

var fpExport = new IndicatorExport(strategy, fpIndicator,
ExportDataSource.Level1, ExportTemporality.Historical,
ExportGranularity.Bar, args);

fpExport.DataSet.Schema
.Append(IndValue.POC)
.Append(IndValue.Delta)
.Append(IndValue.Volume);

pipeline.Add(true, fpExport);
pipeline.ExportDates(beginTime, endTime);

Enums

ExportTemporality

[Flags]
public enum ExportTemporality
{
Historical = 1,
Realtime = 2
}
ValueDescription
HistoricalExport historical bar data after loading
RealtimeExport data as it arrives in real time

ExportDataSource

ValueDescription
Level1Level 1 (trade/tick) data
Level2Level 2 (market depth) data
CustomCustom data source

ExportGranularity

ValueDescription
TickOne row per tick
BarOne row per bar
UpdateOne row per update event

ExportMode

ValueDescription
SaveWrite data to output
LoadRead data from file

ExportArgs

Configuration object passed to all export constructors.

PropertyTypeDefaultDescription
FileNamestringOutput file name (e.g., "data.csv")
BaseDirectorystringnullRoot directory (null = strategy default \data)
SubDirectorystringSubdirectory within base
IsHeaderboolfalseInclude column header row
IsTimeboolfalseInclude Time column
IsFilebooltrueWrite to file
IsNinjaScriptOutputboolfalseWrite to NinjaScript Output panel
IsExportWhileCollectingboolfalseStream rows as they are added
IsBatchboolfalseCreate numbered batch files
Delimiterchar,Column delimiter
SignedVolumeboolfalsePrefix volumes with sign (+buy, −sell)
Shiftint0Bar shift for exported items

Constants

ConstantValueDescription
Export.DELIMITER,Default delimiter
Export.TIME_FORMATyyyy-MM-ddTHH:mm:ss.fffTimestamp format
Export.APPENDtrueAppend mode flag

See Also