10-20-2011, 02:16 PM
|
#621 |
Join Date: Mar 2007 Location: In Da House Thanks: 129
Thanked 1,054 Times in 702 Posts
| Re: Volume Splitter Here you go...be aware of the issues with insidebid insideask (they are discussed earlier in the thread Code:
inputs:
UpColor(darkgreen),
DownColor(red),
DeltaBar(1),
MaxBlock(9999),
MinBlock(0),
ResetDeltaEachBar(0);
variables:
MyVol(0),
Block(0),
color(yellow),
intrabarpersist MyCurrentBar(0),
intrabarpersist VolumeAtBid(0),
intrabarpersist VolumeAtAsk(0),
intrabarpersist BAVolRatio(0),
intrabarpersist VolTmp(0),
intrabarpersist Delta (0),
intrabarpersist DeltaH (0),
intrabarpersist DeltaL (0),
intrabarpersist DeltaO (0);
if LastBarOnChart then begin
MyVol = Iff(BarType < 2, Ticks, Volume);
if CurrentBar > MyCurrentBar then begin
VolumeAtBid = 0;
VolumeAtAsk = 0;
BAVolRatio = 0;
VolTmp = 0;
MyCurrentBar = CurrentBar;
if ResetDeltaEachbar = 1 then Delta =0;
DeltaO = Delta;
DeltaH = Delta;
DeltaL = Delta;
end;
Block = Myvol - VolTmp;
if (Block >= MinBlock) and (Block <= MaxBlock) then
if Close <= InsideBid then
Delta = Delta - MyVol + VolTmp
else if Close >= InsideAsk then
Delta = Delta + MyVol - VolTmp ;
VolTmp = MyVol ;
end;
DeltaH = maxlist(DeltaH, Delta);
DeltaL = minlist(DeltaL, Delta);
if Delta <= 0 then color = DownColor else color = UpColor;
plot1(DeltaO, "DO");
Plot2(DeltaH, "DH");
Plot3(DeltaL, "DL");
plot4(Delta, "DC"); |
| |