/* * 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; namespace QuantConnect.Indicators { /// /// Represents an Indicator of the Market Profile with Volume Profile mode and its attributes /// public class VolumeProfile: MarketProfile { /// /// Creates a new VolumeProfile indicator with the specified period /// /// The period of the indicator public VolumeProfile(int period = 2) : this($"VP({period})", period) { } /// /// Creates a new VolumeProfile indicator with the specified name, period and priceRangeRoundOff /// /// The name of this indicator /// The period of this indicator /// The percentage of volume contained in the value area /// How many digits you want to round and the precision. /// i.e 0.01 round to two digits exactly. public VolumeProfile(string name, int period, decimal valueAreaVolumePercentage = 0.70m, decimal priceRangeRoundOff = 0.05m) : base(name, period, valueAreaVolumePercentage, priceRangeRoundOff) { } /// /// Define the Volume for the Volume Profile mode /// /// /// The volume of the input Data Point protected override decimal GetVolume(TradeBar input) { return input.Volume; } } }