Overall Statistics Total Trades4250Average Win0.30%Average Loss-0.65%Compounding Annual Return-72.756%Drawdown98.500%Expectancy-0.333Net Profit-92.333%Sharpe Ratio0.313Loss Rate54%Win Rate46%Profit-Loss Ratio0.46Alpha1.348Beta-48.949Annual Standard Deviation1.792Annual Variance3.211Information Ratio0.304Tracking Error1.792Treynor Ratio-0.011Total Fees\$0.00
```import numpy as np
import pandas as pd
from datetime import datetime
import decimal as d

### <summary>
### Basic template algorithm simply initializes the date range and cash. This is a skeleton
### framework you can use for designing an algorithm.
### </summary>
class BasicTemplateAlgorithm(QCAlgorithm):
'''Basic template algorithm simply initializes the date range and cash'''

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.'''

self.SetStartDate(2017,1, 10)  #Set Start Date
self.SetEndDate(2018,12,31)    #Set End Date
self.SetCash(10000)           #Set Strategy Cash
# Find more symbols here: http://quantconnect.com/data
self.SetTimeZone("Etc/GMT0")
#self.Schedule.On(self.DateRules.EveryDay("EURUSD"), self.TimeRules.Every("Hour"), self.EveryHour)
def OnData(self, data):
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.

Arguments:
data: Slice object keyed by symbol containing the stock data
'''
if data.ContainsKey("EURUSD"):
quoteBar = data['EURUSD']
self.Log(f"Time: {quoteBar.EndTime}") #The time the period closes
self.Log(f"Open: {quoteBar.Open}")
price = float(data["EURUSD"].Price)
self.Sell("EURUSD", 100)
else:
pass

def OnOrderEvent(self, orderEvent):
order = self.Transactions.GetOrderById(orderEvent.OrderId)

if order.Status == OrderStatus.Filled:
if order.Type == OrderType.Limit or order.Type == OrderType.Limit:
self.Transactions.CancelOpenOrders(order.Symbol)

if order.Status == OrderStatus.Canceled:
self.Log(str(orderEvent))

def EveryHour(self):
pass```