src/Deepdom/Basics/SessionCvd.cs
The cumulative delta of the session: every trade at the ask adds its size, every trade at the bid subtracts it.
What it shows
OnTickfor every trade.CallHandler.FullandOnIniParallelTick: the trades before the first bar of the chart.- One accumulator per core and the merge.
The trades before the first bar
The chart shows the last part of the session, but a cumulative delta starts at the open. WithOnTickCall = CallHandler.Full the indicator receives the earlier trades in OnIniParallelTick, split between the cores of the computer and given in parallel. Each core adds to its own total:
Merge() is the first line of OnTick, OnTickClose and OnEnd: whichever comes first does the merge.
The side of a trade
Things to notice
- Nothing is shared between the cores while the parallel pass runs: only the array, with one cell per core.
OnLoadresets the totals and themergedflag: the chart is loaded again as the session goes on, and the pass runs again.- The points follow the same pattern as Bar Delta: added in
OnOpen, written inOnTickClose, updated inOnEnd.
Try
- Add a parameter to ignore the trades below a size.
- Draw the delta of the bid side and of the ask side as two lines.