Skip to content

Commit

Permalink
Created StrategyBase for further development
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Song committed Jun 9, 2019
1 parent c06e44f commit 007786f
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions alpha/strategies/strategy_base.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"outputs": [],
"source": "# %%file strategy_base.py\n\nimport six\nfrom abc import ABCMeta, abstractmethod\n\nclass TradeStrategyBase(six.with_metaclass(ABCMeta, object)):\n \"\"\"\n Trading Strategy Abstract Base Class\n \"\"\"\n @abstractmethod\n def trade(self, *args, **kwargs):\n # Base Buy Strategy \n pass\n \n @abstractmethod\n def _evaluate_buying(self, *args, **kwargs):\n # Base Buy Strategy \n pass\n \n @abstractmethod\n def _execute_buying(self, *args, **kwargs):\n # Base Buy Strategy \n pass\n \n @abstractmethod\n def _evaluate_selling(self, *args, **kwargs):\n # Base Buy Strategy \n pass\n \n @abstractmethod\n def _execute_selling(self, *args, **kwargs):\n # Base Sell Strategy\n pass",
"metadata": {
"pycharm": {
"metadata": false,
"name": "#%% Trading Strategy Abstract Base Class\n",
"is_executing": false
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": "\n",
"metadata": {
"pycharm": {
"metadata": false,
"name": "#%%\n"
}
}
}
],
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
},
"kernelspec": {
"name": "python3",
"language": "python",
"display_name": "Python 3"
},
"stem_cell": {
"cell_type": "raw",
"source": "",
"metadata": {
"pycharm": {
"metadata": false
}
}
}
},
"nbformat": 4,
"nbformat_minor": 0
}

0 comments on commit 007786f

Please sign in to comment.