S#.API
Atom
10.08.2015


обнаружена ошибка в файле CandleBulder.cs в выделенной строчке:
Цитата:
protected virtual void UpdateCandle(CandleSeries series, TCandle candle, ICandleBuilderSourceValue value)
{
if (candle == null)
throw new ArgumentNullException("candle");

if (value == null)
throw new ArgumentNullException("value");

if (value.Price < candle.LowPrice)
{
candle.LowPrice = value.Price;
candle.LowTime = value.Time;
}

if (value.Price > candle.HighPrice)
{
candle.HighPrice = value.Price;
candle.HighTime = value.Time;
}

candle.ClosePrice = value.Price;
candle.TotalPrice += value.Price * value.Volume;

candle.LowVolume = (candle.LowVolume ?? 0m).Min(value.Volume);
candle.HighVolume = (candle.HighVolume ?? 0m).Max(value.Volume);
candle.CloseVolume = value.Volume;
candle.TotalVolume += value.Volume;

if (value.OrderDirection != null)
{
candle.RelativeVolume += value.OrderDirection == Sides.Buy ? value.Volume : -value.Volume;
}


candle.CloseTime = value.Time;

if (series.IsCalcVolumeProfile)
candle.VolumeProfileInfo.Update(value);
}


candle.RelativeVolume всегда будет null
у себя переделал код:
Цитата:
if (value.OrderDirection != null)
{
var volumeDirect = value.OrderDirection == Sides.Buy ? value.Volume : -value.Volume;
candle.RelativeVolume = candle.RelativeVolume != null ? candle.RelativeVolume.Value + volumeDirect : volumeDirect;
}

Теперь candle.RelativeVolume заполняется корректно

Теги:


Спасибо: Mikhail Sukhov


Mikhail Sukhov

Фотография
Дата: 11.08.2015
Ответить


В след раз делайте Пул Реквесты. Это не долго, но нагляднее.
Спасибо:


Добавить файлы через драг-н-дроп, , или вставить из буфера обмена.

loading
clippy