/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using QuantConnect.Data.Market;
using QuantConnect.Data.Consolidators;
using QuantConnect.Data;
namespace Common.Data.Consolidators
{
///
/// This consolidator transforms a stream of instances into a stream of
/// with a constant dollar volume for each bar.
///
public class DollarVolumeRenkoConsolidator : VolumeRenkoConsolidator
{
///
/// Initializes a new instance of the class using the specified .
///
/// The constant dollar volume size of each bar
public DollarVolumeRenkoConsolidator(decimal barSize)
: base(barSize)
{
}
///
/// Converts raw volume into dollar volume by multiplying it with the trade price.
///
/// The raw trade volume
/// The trade price
/// The dollar volume
protected override decimal AdjustVolume(decimal volume, decimal price)
{
return volume * price;
}
}
}