Skip to content

Instantly share code, notes, and snippets.

class EditableCell extends React.Component {
state = {
value: this.props.value,
editable: this.props.editable || false,
};
componentWillReceiveProps(nextProps) {
if (nextProps.editable !== this.state.editable) {
this.setState({ editable: nextProps.editable });
if (nextProps.editable) {
this.cacheValue = this.state.value;
count_outcomes_by_condition <- function(my_data, cond){
ret = apply.weekly(na.omit(my_data), function(r){sum(eval(parse(text=cond)))})
names(ret)[1] = cond
return(ret)
}
xts2df <- function(x) {
res_qqq_df = xts2df(res_qqq)
data.frame(date=index(x), coredata(x))
}
import QuantLib as ql # version 1.5
#import matplotlib.pyplot as plt
#%matplotlib inline
# option data
maturity_date = ql.Date(1, 6, 2018)
spot_price = 2720
strike_price = 2725
volatility = 0.13 # the historical vols for a year
dividend_rate = 0.0
from ibapi.wrapper import EWrapper
from ibapi.client import EClient
from ibapi.contract import Contract as IBcontract
from threading import Thread
import queue
import datetime
import time
import time
import random
import asyncio
from ib_insync import *
from collections import namedtuple
LiveFuturesSettings = namedtuple('LiveFuturesSettings',
'tickers, exchange, bar_size, whatToShow, influx_measurement, log_filename,')
\documentclass[12pt, twoside]{report}
\usepackage[a4paper,width=150mm, top=25mm, bottom=25mm, bindingoffset=6mm]{geometry}
\usepackage{minted}
\usepackage{caption}
\usepackage[backend=biber,style=numeric,hyperref=true]{biblatex}
\setlength{\parindent}{1em}
\setlength{\parskip}{1em}
\raggedbottom
\begin{document}