Код: Выделить всё
function Initialize()
{
IndicatorName = "VolumeBidAskAccum";
PriceStudy = false;
AddInput("Input", Inputs.Candle);
AddSeries("Bid", DrawAs.Histogram, Color.Red, AxisType.ZeroBased);
AddSeries("Ask", DrawAs.Histogram, Color.Green, AxisType.ZeroBased);
AddGlobalVariable("VABid", Types.Int, 0);
AddGlobalVariable("VAAsk", Types.Int, 0);
}
function Evaluate()
{
if (BarDate() != BarDate(1)) { VABid = 0; VAAsk = 0; }
VABid -= (int)Input.VolumeBid;
VAAsk += (int)Input.VolumeAsk;
Bid = VABid;
Ask = VAAsk;
}