/*
* 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 System;
namespace QuantConnect.Data.Market
{
///
/// Represents a bar sectioned not by time, but by some amount of movement in a set field,
/// where:
/// - Open : Gets the opening value that started this bar
/// - Close : Gets the closing value or the current value if the bar has not yet closed.
/// - High : Gets the highest value encountered during this bar
/// - Low : Gets the lowest value encountered during this bar
///
public abstract class BaseRenkoBar : TradeBar, IBaseDataBar
{
///
/// Gets the kind of the bar
///
public RenkoType Type { get; protected set; }
///
/// The preset size of the consolidated bar
///
public decimal BrickSize { get; protected set; }
///
/// Gets the end time of this renko bar or the most recent update time if it
///
public override DateTime EndTime { get; set; }
///
/// Gets the time this bar started
///
public DateTime Start
{
get { return Time; }
protected set { Time = value; }
}
///
/// Gets whether or not this bar is considered closed.
///
public virtual bool IsClosed { get; protected set; }
///
/// Reader Method :: using set of arguements we specify read out type. Enumerate
/// until the end of the data stream or file. E.g. Read CSV file line by line and convert
/// into data types.
///
/// BaseData type set by Subscription Method.
/// Config.
/// Line.
/// Date.
/// true if we're in live mode, false for backtesting mode
public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, bool isLiveMode)
{
throw new NotSupportedException("RenkoBar does not support the Reader function. This function should never be called on this type.");
}
///
/// Return the URL string source of the file. This will be converted to a stream
///
/// Configuration object
/// Date of this source file
/// true if we're in live mode, false for backtesting mode
/// String URL of source file.
public override SubscriptionDataSource GetSource(SubscriptionDataConfig config, DateTime date, bool isLiveMode)
{
throw new NotSupportedException("RenkoBar does not support the GetSource function. This function should never be called on this type.");
}
}
}