| Overall Statistics |
|
Total Trades 0 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 0% Expectancy 0 Net Profit 0% Sharpe Ratio 0 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0 Beta 0 Annual Standard Deviation 0 Annual Variance 0 Information Ratio 0 Tracking Error 0 Treynor Ratio 0 Total Fees $0.00 |
/*
* 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;
using QuantConnect.Data.Market;
namespace QuantConnect.Algorithm.CSharp
{
/// <summary>
/// Algorithm demonstrating custom charting support in QuantConnect.
/// The entire charting system of quantconnect is adaptable. You can adjust it to draw whatever you'd like.
/// Charts can be stacked, or overlayed on each other. Series can be candles, lines or scatter plots.
/// Even the default behaviours of QuantConnect can be overridden.
/// </summary>
/// <meta name="tag" content="charting" />
/// <meta name="tag" content="adding charts" />
/// <meta name="tag" content="series types" />
/// <meta name="tag" content="plotting indicators" />
public class CustomChartingAlgorithm : QCAlgorithm
{
/// <summary>
/// Called at the start of your algorithm to setup your requirements:
/// </summary>
public override void Initialize()
{
//Set the date range you want to run your algorithm:
SetStartDate(2015,1,1);
SetEndDate(2015,1,31);
//Set the starting cash for your strategy:
SetCash(100000);
//Add any stocks you'd like to analyse, and set the resolution:
// Find more symbols here: http://quantconnect.com/data
AddSecurity(SecurityType.Equity, "SPY", Resolution.Hour);
var myChart = new Chart("Chart1");
var mySeries = new Series("Series1", SeriesType.Candle);
myChart.AddSeries( mySeries );
AddChart( myChart );
}
/// <summary>
/// On receiving new tradebar data it will be passed into this function. The general pattern is:
/// "public void OnData( CustomType name ) {...s"
/// </summary>
/// <param name="data">TradeBars data type synchronized and pushed into this function. The tradebars are grouped in a dictionary.</param>
public void OnData(TradeBars data)
{
var _lastPrice = data["SPY"].Close;
Plot("Chart1", "Series1", _lastPrice);
}
}
}