Two questions I have are as follows, the rest of the code I think I will I get program it.
1 as was desiganan to variables in the code are as intrabar persist.
This type of variables will be updating with bar without closing.
2. the second is that function returns insideask and insidebid, which are the best price at which are the bid and the ask and tradestation are snapshot.
Thank you
inputs:
Period(20),
UpColor(green),
DownColor(red);
variables:
MyVol(0),
Color(yellow),
SmoothedBA(0),
Length(squareroot(Period)),
intrabarpersist MyCurrentBar(0),
intrabarpersist VolumeAtBid(0),
intrabarpersist VolumeAtAsk(0),
intrabarpersist BAVolRatio(0),
intrabarpersist VolTmp(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;
end;
if InsideBid < InsideAsk then begin
if Close <= InsideBid then
VolumeAtBid = VolumeAtBid + MyVol - VolTmp
else if Close >= InsideAsk then
VolumeAtAsk = VolumeAtAsk + MyVol - VolTmp ;
end;

Comment