/*
* 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 Time Price Opportunity (TPO) mode and its attributes
///
public class TimeProfile: MarketProfile
{
///
/// Creates a new TimeProfile indicator with the specified period
///
/// The period of this indicator
public TimeProfile(int period = 2)
: this($"TP({period})", period)
{
}
///
/// Creates a new TimeProfile 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 TimeProfile(string name, int period, decimal valueAreaVolumePercentage = 0.70m, decimal priceRangeRoundOff = 0.05m)
: base(name, period, valueAreaVolumePercentage, priceRangeRoundOff)
{ }
///
/// Define the Volume in Time Profile mode
///
///
/// 1
protected override decimal GetVolume(TradeBar input)
{
return 1;
}
}
}