| Overall Statistics |
|
Total Trades 1045 Average Win 0.00% Average Loss 0.00% Compounding Annual Return 52.779% Drawdown 0.600% Expectancy 0.240 Net Profit 0.553% Sharpe Ratio 5.599 Loss Rate 55% Win Rate 45% Profit-Loss Ratio 1.76 Alpha -0.322 Beta 54.419 Annual Standard Deviation 0.05 Annual Variance 0.002 Information Ratio 5.395 Tracking Error 0.05 Treynor Ratio 0.005 Total Fees $0.00 |
from Alphas.ConstantAlphaModel import ConstantAlphaModel
from Execution.ImmediateExecutionModel import ImmediateExecutionModel
from Risk.MaximumDrawdownPercentPerSecurity import MaximumDrawdownPercentPerSecurity
from Portfolio.EqualWeightingPortfolioConstructionModel import EqualWeightingPortfolioConstructionModel
from datetime import timedelta
import numpy as np
### <summary>
### Basic template framework algorithm uses framework components to define the algorithm.
### </summary>
### <meta name="tag" content="using data" />
### <meta name="tag" content="using quantconnect" />
### <meta name="tag" content="trading and orders" />
class BasicTemplateFrameworkAlgorithm(QCAlgorithmFramework):
'''Basic template framework algorithm uses framework components to define the algorithm.'''
def Initialize(self):
''' Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''
# Set requested data resolution
self.UniverseSettings.Resolution = Resolution.Minute
self.SetStartDate(2013,10,7) #Set Start Date
self.SetEndDate(2013,10,11) #Set End Date
self.SetCash(100000) #Set Strategy Cash
# Find more symbols here: http://quantconnect.com/data
# Forex, CFD, Equities Resolutions: Tick, Second, Minute, Hour, Daily.
# Futures Resolution: Tick, Second, Minute
# Options Resolution: Minute Only.
symbols = [ Symbol.Create('EURUSD', SecurityType.Forex, Market.Oanda),
Symbol.Create('EURJPY', SecurityType.Forex, Market.Oanda)]
# set algorithm framework models
self.SetUniverseSelection(ManualUniverseSelectionModel(symbols))
self.SetAlpha(ConstantAlphaModel(InsightType.Price, InsightDirection.Up, timedelta(minutes = 20), 0.025, None))
self.SetPortfolioConstruction(EqualWeightingPortfolioConstructionModel())
self.SetExecution(ImmediateExecutionModel())
self.SetRiskManagement(MaximumDrawdownPercentPerSecurity(0.01))
def OnOrderEvent(self, orderEvent):
if orderEvent.Status == OrderStatus.Filled:
self.Debug("Purchased Stock: {0}".format(orderEvent.Symbol))