Skip to content

Commit

Permalink
Add Binder parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedamen committed Jun 17, 2020
1 parent 977e9d6 commit af7f87c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tcapy_notebooks/market_microstructure_with_tcapy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's also set the market data source, either downloading it from a prepopulated database, or if we haven't got access to that (eg. we're running the code in Binder), we can try downloading directly from our external data source (although this might be slow)."
"Let's also set the market data source, either downloading it from a prepopulated database, or if we haven't got access to that (eg. we're running the code in Binder), we can try downloading directly from our external data source (although this might be slow). Make sure you change the `running_on_binder` boolean, if you are running on Binder. This will also prevent it from doing multithreading which we haven't yet enabled on Binder."
]
},
{
Expand All @@ -166,7 +166,11 @@
"outputs": [],
"source": [
"market_data_store = 'arctic-dukascopy' # If we have already populated an Arctic database\n",
"# market_data_store = 'dukascopy' # Directly downloading from Dukascopy (note: slow!)"
"\n",
"running_on_binder = False # Change to True if you're running on Binder\n",
"\n",
"if running_on_binder:\n",
" market_data_store = 'dukascopy' # Directly downloading from Dukascopy (note: slow!)"
]
},
{
Expand Down Expand Up @@ -361,8 +365,10 @@
},
"outputs": [],
"source": [
"tca_request.use_multithreading = True\n",
"tca_request.multithreading_params['splice_request_by_dates'] = True\n",
"if not(running_on_binder):\n",
" tca_request.use_multithreading = True\n",
" tca_request.multithreading_params['splice_request_by_dates'] = True\n",
" \n",
"volatile_cache = Mediator.get_volatile_cache()\n",
"volatile_cache.clear_cache()"
]
Expand Down Expand Up @@ -430,7 +436,8 @@
}
],
"source": [
"dict_of_df = tca_engine.calculate_tca(tca_request)"
"if not(running_on_binder):\n",
" dict_of_df = tca_engine.calculate_tca(tca_request)"
]
},
{
Expand Down

0 comments on commit af7f87c

Please sign in to comment.