Hi kyleforb,
- ) Your performance might be affected by the fact that your Tick DB is handling 4 Million data points and I am sure that AmiBroker is the only program that can comfortably do that. Whch Symbols will you trade? I am trading @ES# only and 4 Million Ticks gives me 3 - 5 days of data depending how heavily ES is traded. @MES# gives me about 8- 10 days of data. So you can adjust the Tick Size of your DB to suit your needs. The lesser ticks, the faster processing. We will soon know if you have set it up properly.
2.) The Locking of Interval is the Pad Lock Symbol:

3.) Let's start with the basics. Place this code in your Tick Chart (empottasch and I have fine-tuned this code together) :
_SECTION_BEGIN( "DELTA VOLUME MASTER" );
SetBarsRequired( sbrAll, sbrAll );
BI = BarIndex();
LastBI = LastValue( BI );
Ticker = Name();
TF = StaticVarGet( "~ChartTF" );
Ticker = Name();
function SumSinceInclusive( Condition, Array )
{
return SumSince( Condition, Array ) + ValueWhen( Condition, Array );
}
if( TF > 0 )
{
LastBarOfPeriod = Nz( TimeFrameExpand( 1, TF, expandPoint ) );
FirstBarOfPeriod = Ref( LastBarOfPeriod, -1 );
}
else
{
ChartBI = Nz( StaticVarGet( "~ChartBI", True ) );
LastBarOfPeriod = ChartBI != Ref( ChartBI, -1 );
FirstBarOfPeriod = Ref( LastBarOfPeriod, -1 );
LastBarOfPeriod[ BarCount - 1 ] = 1;
}
BuyVolume = IIf( Close >= Aux2 AND Aux2 != Aux1, Volume, 0 );
SellVolume = IIf( Close <= Aux1 AND Aux2 != Aux1, Volume, 0 );
CumBuyVolume = SumSinceInclusive( FirstBarOfPeriod, BuyVolume );
CumBuyVolumeTotal = Ref( ValueWhen( LastBarOfPeriod OR BI == ( BarCount - 1 ), CumBuyVolume, 0 ), -1 );
LastValueCumBuyVolumeTotal = LastValue( CumBuyVolumeTotal );
CumSellVolume = SumSinceInclusive( FirstBarOfPeriod, SellVolume );
CumSellVolumeTotal = Ref( ValueWhen( LastBarOfPeriod OR BI == ( BarCount - 1 ), CumSellVolume, 0 ), -1 );
LastValueCumSellVolumeTotal = LastValue( CumSellVolumeTotal );
StaticVarSet( "~BuyVolume" + Ticker + TF, CumBuyVolumeTotal, False );
StaticVarSet( "~SellVolume" + Ticker + TF, CumSellVolumeTotal, False );
StaticVarSet( "~LastBuyVolume" + Ticker + TF, LastValueCumBuyVolumeTotal, False );
StaticVarSet( "~LastSellVolume" + Ticker + TF, LastValueCumSellVolumeTotal, False );
// calculate OHLC
DeltaVolume = CumBuyVolume - CumSellVolume; // intrabar DeltaVolume
// Intrabar Delta Volume Open
DeltaVolumeOpen = ValueWhen( FirstBarOfPeriod, DeltaVolume );
DeltaVolumeOpen = Ref( ValueWhen( LastBarOfPeriod OR BI == ( BarCount - 1 ), DeltaVolumeOpen, 0 ), -1 );
LastValueDeltaVolumeOpen = LastValue( DeltaVolumeOpen );
// Intrabar Delta Volume High
DeltaVolumeHigh = HighestSince( FirstBarOfPeriod, DeltaVolume );
DeltaVolumeHigh = Ref( ValueWhen( LastBarOfPeriod OR BI == ( BarCount - 1 ), DeltaVolumeHigh, 0 ), -1 );
LastValueDeltaVolumeHigh = LastValue( DeltaVolumeHigh );
// Intrabar Delta Volume Low
DeltaVolumeLow = LowestSince( FirstBarOfPeriod, DeltaVolume );
DeltaVolumeLow = Ref( ValueWhen( LastBarOfPeriod OR BI == ( BarCount - 1 ), DeltaVolumeLow, 0 ), -1 );
LastValueDeltaVolumeLow = LastValue( DeltaVolumeLow );
// Intrabar Delta Volume Close
DeltaVolumeClose = Ref( ValueWhen( LastBarOfPeriod OR BI == ( BarCount - 1 ), DeltaVolume, 0 ), -1 );
LastValueDeltaVolumeClose = LastValue( DeltaVolumeClose );
StaticVarSet( "~DeltaOpen" + Ticker + TF, DeltaVolumeOpen );
StaticVarSet( "~DeltaHigh" + Ticker + TF, DeltaVolumeHigh );
StaticVarSet( "~DeltaLow" + Ticker + TF, DeltaVolumeLow );
StaticVarSet( "~DeltaClose" + Ticker + TF, DeltaVolumeClose );
StaticVarSet( "~LastDeltaOpen" + Ticker + TF, LastValueDeltaVolumeOpen );
StaticVarSet( "~LastDeltaHigh" + Ticker + TF, LastValueDeltaVolumeHigh );
StaticVarSet( "~LastDeltaLow" + Ticker + TF, LastValueDeltaVolumeLow );
StaticVarSet( "~LastDeltaClose" + Ticker + TF, LastValueDeltaVolumeClose );
// PLOT THE TICK DATA:
SetBarFillColor( colorBrightGreen );
PlotOHLC( 0, BuyVolume, 0, BuyVolume, "BUY", colorBrightGreen, styleCandle, Null, Null, Null, 0, 1 );
SetBarFillColor( colorRed );
PlotOHLC( 0, SellVolume, 0, SellVolume, "SELL", colorRed, styleCandle, Null, Null, Null, 0, 1 );
Plot( Close, "CLOSE", colorWhite, styleLeftAxisScale | styleStaircase, Null, Null, Null, 2, 1 );
Plot( Aux2, "", colorPaleGreen, styleLeftAxisScale | styleDashed | styleStaircase, Null, Null, Null, 3, 1 );
Plot( Aux1, "", colorPink, styleLeftAxisScale | styleDashed | styleStaircase, Null, Null, Null, 3, 1 );
Title = "DELTA VOLUME MASTER";
_SECTION_END();
Then in your 1-Minute chart, Symbol linked to your Tick Chart, you add this code to it's own pane:
_SECTION_BEGIN( "MAIN CHART" );
DeltaType = ParamToggle( "Delta Plot Style", "OHLC|LINE", 1 );
BI = BarIndex();
LastBI = LastValue( BI );
Ticker = Name();
TF = Interval( 1 );
// DATA FOR THE TICK CHART:
StaticVarSet( "~ChartTF", TF );
StaticVarSet( "~ChartBI", BI );
BuyVolume = StaticVarGet( "~BuyVolume" + Ticker + TF );
LastBuyVolume = StaticVarGet( "~LastBuyVolume" + Ticker + TF );
BuyVolume[ LastBI ] = LastBuyVolume;
SellVolume = StaticVarGet( "~SellVolume" + Ticker + TF );
LastSellVolume = StaticVarGet( "~LastSellVolume" + Ticker + TF );
SellVolume[ LastBI ] = LastSellVolume;
if( DeltaType )
{
// STANDARD DELTA VOLUME LINE PLOT:
DeltaVolume = Cum( BuyVolume - SellVolume );
Plot( DeltaVolume, "DELTA VOLUME", colorYellow, styleLine, Null, Null, 0, 0, 1 );
}
else
{
// OHLC DELTA VOLUME PLOT:
DeltaVolumeOpen = StaticVarGet( "~DeltaOpen" + Ticker + TF );
LastValueDeltaVolumeOpen = StaticVarGet( "~LastDeltaOpen" + Ticker + TF );
DeltaVolumeOpen[ LastBI ] = LastValueDeltaVolumeOpen;
DeltaVolumeHigh = StaticVarGet( "~DeltaHigh" + Ticker + TF );
LastValueDeltaVolumeHigh = StaticVarGet( "~LastDeltaHigh" + Ticker + TF );
DeltaVolumeHigh[ LastBI ] = LastValueDeltaVolumeHigh;
DeltaVolumeLow = StaticVarGet( "~DeltaLow" + Ticker + TF );
LastValueDeltaVolumeLow = StaticVarGet( "~LastDeltaLow" + Ticker + TF );
DeltaVolumeLow[ LastBI ] = LastValueDeltaVolumeLow;
DeltaVolumeClose = StaticVarGet( "~DeltaClose" + Ticker + TF );
LastValueDeltaVolumeClose = StaticVarGet( "~LastDeltaClose" + Ticker + TF );
DeltaVolumeClose[ LastBI ] = LastValueDeltaVolumeClose;
// CREATING THE CUMULATIVE DELTA OHLC:
CumDeltaClose = Cum( DeltaVolumeClose );
CumDeltaOpen = Ref( CumDeltaClose, -1 );
CumDeltaHigh = IIf( DeltaVolumeClose > DeltaVolumeOpen, CumDeltaClose + abs( DeltaVolumeHigh - DeltaVolumeClose ), CumDeltaOpen + abs( DeltaVolumeHigh - DeltaVolumeOpen ) );
CumDeltaLow = IIf( DeltaVolumeClose > DeltaVolumeOpen, CumDeltaOpen - abs( DeltaVolumeLow - DeltaVolumeOpen ), CumDeltaClose - abs( DeltaVolumeLow - DeltaVolumeClose ) );
BarColor = IIf( CumDeltaClose >= CumDeltaOpen, colorWhite, colorGrey50 );
SetBarFillColor( IIf( CumDeltaClose >= CumDeltaOpen, colorWhite, colorGrey50 ) );
PlotOHLC( CumDeltaOpen, CumDeltaHigh, CumDeltaLow, CumDeltaClose, "DELTA VOLUME", BarColor, styleCandle, Null, Null, 0, 0, 1 );
}
_SECTION_END();
So now you should be able to view the Cumulative Delta Volume with the option to plot it as Line or as a OHLC Plot. The MKT/LMT Volumes we take later once you have this up and running.
4.) Yes, you have to install the latest AB Beta Version. The new IQFeed Plugin is not yet officially launched.
No Problem, you are welcome! My thinking is like this: Tomasz is giving his AmiBroker Community the most amazing and solid support and I have worked with him several times when he created some solutions such as being able to identify Buy/Sell Volumes and Consolidate Trades in the IQFeed Plugin! So this is now my way to thank Tomasz by contributing my knowledge, so more users start to use his great features for more advanced analysis. The days when we could make profits using lagging data is long gone! As you know, it's all about Give and Take. So I would highly appreciate that anyone using my code will also share what they came up with. 
It would for sure be interesting if we could get a dialog going in the Forum discussing Advance Analysis on how to beat the "Big Boys" in their own game using the data we now have access to. The "Big Boys" have help of hundreds or programmers, we Retail Traders are on our own. So the more people on this Forum start to discuss this, the higher is the chance of trading success.
Regards,
Jorgen