Member-only story
Test harness is important to evaluate trading strategy
Simple Way of Evaluating Algorithmic Trading Strategy
Designing a financial trading strategy
7 min readDec 26, 2020
https://sarit-maitra.medium.com/membership
Back-testing is an important step to get the statistics to ensure effective trading strategy. It comes with some of the key points such as profit and loss, net profit and loss, invested capital, number of trades/orders return, Sharpe ratio etc. Here, we will discuss as how to design a financial trading strategy using open source Python tools and we’ll review the results of the back-test by going through some plots generated by pyfolio.
Let us load the data as shown below.
Function to extract data:
def dataExtraction():
dataset = web.DataReader('^IXIC', data_source = 'yahoo', start = '2010-01-01')
dataset = dataset.sort_index(ascending=True)
# Plot the closing prices
dataset['Adj Close'].plot(grid=True, figsize=(10, 6))
plt.title('Nasdaq Composite close price')
plt.ylabel('price ($)')
plt.show()
return dataset
dataset = dataExtraction()
print(dataset)