Skip to content

Instantly share code, notes, and snippets.

View robcarver17's full-sized avatar

Robert Carver robcarver17

View GitHub Profile
import pandas as pd
import numpy as np
def get_expected_risk_for_system(system):
value_of_positions_proportion_capital = get_positions_as_proportion_of_capital(system)
instrument_returns = get_instrument_returns(system)
instrument_returns = instrument_returns.ffill().reindex(value_of_positions_proportion_capital.index)
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway:
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway:
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway:
import numpy as np
from systems.provided.futures_chapter15.basesystem import *
import numpy as np
from syscore.algos import robust_vol_calc
## test kurtosis AND skew with trading rules
@robcarver17
robcarver17 / temp.py
Last active January 2, 2024 06:02
Get IB historical data native python API updated for bar class
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway: