This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Clean and simple Keras implementation of network architectures described in: | |
- (ResNet-50) [Deep Residual Learning for Image Recognition](https://arxiv.org/pdf/1512.03385.pdf). | |
- (ResNeXt-50 32x4d) [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/pdf/1611.05431.pdf). | |
Python 3. | |
""" | |
from keras import layers | |
from keras import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from datetime import datetime, timedelta | |
# Copies logic from https://www.quantconnect.com/tutorials/strategy-library/fundamental-factor-long-short-strategy | |
# Algo storing - https://www.quantconnect.com/docs/algorithm-framework/algorithm-scoring | |
class ChartMillBackTester(QCAlgorithm): | |
def Initialize(self): | |
self.SetCash(1000*100) # Are't we rich? :D |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from btgym import BTgymEnv | |
import IPython.display as Display | |
import PIL.Image as Image | |
from gym import spaces | |
import gym | |
import numpy as np | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction. | |
""" | |
from __future__ import print_function, division | |
import numpy as np | |
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten | |
from keras.models import Sequential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
def compute_market_prices(prices): | |
"""Compute market prices according to the trading competition recipe. | |
Parameters | |
---------- | |
prices : DataFrame |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm(list = ls()) | |
gc() | |
library(knitr) | |
library(blotter) | |
if (!exists('.blotter')) .blotter <- new.env() | |
suppressWarnings(try(rm(list=c("account.forex","portfolio.forex"),pos=.blotter),silent=TRUE)) | |
suppressWarnings(try(rm(list=c("b.strategy","myTheme","EURUSD",".getSymbols")),silent=TRUE)) |