
01-30-2007, 07:31 AM
|
|
insideday
has no status.
|
|
Join Date: Dec 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Re: Collaboration to design a new indicator?
Hi, you could try it realtime with
 |
|
 |
 |
|
 |
|
inputs:
UpColor(green),
DownColor(red);
variables:
MyVol(0),
Color(yellow),
intrabarpersist MyCurrentBar(0),
intrabarpersist VolumeAtBid(0),
intrabarpersist VolumeAtAsk(0),
intrabarpersist BAVolDiff(0),
intrabarpersist VolTmp(0);
if LastBarOnChart then begin
MyVol = Iff(BarType < 2, Ticks, Volume);
if CurrentBar > MyCurrentBar then begin
VolumeAtBid = 0;
VolumeAtAsk = 0;
BAVolDiff= 0;
VolTmp = 0;
MyCurrentBar = CurrentBar;
end;
if InsideBid < InsideAsk then begin
if Close <= InsideBid then
VolumeAtBid = VolumeAtBid + MyVol - VolTmp
else if Close >= InsideAsk then
VolumeAtAsk = VolumeAtAsk + MyVol - VolTmp ;
end;
if VolumeAtBid > 0 and VolumeAtAsk > 0 then BAVolDiff= VolumeAtAsk-VolumeAtBid ;
VolTmp = MyVol ;
end ;
if BAVolDiff<= 0 then color = DownColor else color = UpColor;
plot1(BAVolDiff, "BAVolDiff", color);
Plot2( 0, "ZeroLine" ) ; |
|
 |
|
 |
|
Make sure that you use Trade Volume on Format Symbol.
Regards
|