Skip to content

Instantly share code, notes, and snippets.

Avatar

FemtoTrader femtotrader

View GitHub Profile
View gist:c76004a8597f72d8d9a2c63b5c26816b
Verifying my Blockstack ID is secured with the address 14BzAGWqh8hx72DZ7J5Df71fAeWMzKrckH https://explorer.blockstack.org/address/14BzAGWqh8hx72DZ7J5Df71fAeWMzKrckH
@femtotrader
femtotrader / first_profitable_exit.jl
Created Aug 5, 2018 — forked from flare9x/first_profitable_exit.jl
Exit trade first profitable price over entry
View first_profitable_exit.jl
###############################################################
# exit first profitable price over entry
# exit after fixed bars (max_hold) if no profitable trade
###############################################################
signal = [0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]
close = [10,10,8,3,14,5,6,2,4,22,2,1,1,1,10,3,3,3,3,3,3,30]
first_prof = zero(signal)
max_hold = 6
for i = 1:length(signal) # 1:length(signal)-1 if buying next bar at open
@femtotrader
femtotrader / alpha_vantage.jl
Created Apr 22, 2018 — forked from flare9x/alpha_vantage.jl
Julia - Download free data alphavantage api
View alpha_vantage.jl
# Download Data Using Alphavantage
using HTTP
using StatPlots
res = HTTP.get("https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=AAPL&interval=1min&apikey=your_api_key&datatype=csv")
mycsv = readcsv(res.body)
x = convert(DataFrame, mycsv)
x = x[2:nrow(x),:] # subset remove header row
# Rename Columns
colnames = ["Date","Open","High","Low","Close","Volume"]
@femtotrader
femtotrader / alphavantage.py
Last active Dec 23, 2019
Download data from Alphavantage http://www.alphavantage.co/ using Python, Requests and Pandas
View alphavantage.py
import requests
from pandas.io.common import urlencode
from pandas.tseries.frequencies import to_offset
ALPHAVANTAGE_API_URL = "http://www.alphavantage.co/query"
ALPHAVANTAGE_API_KEY_DEFAULT = "demo"
def _init_session(session):
@femtotrader
femtotrader / lobster_reader.py
Last active Sep 23, 2019
Read Lobster orderbook files to Python Pandas DataFrame
View lobster_reader.py
#!/usr/bin/env python
"""
Read Lobster orderbook files to Python Pandas DataFrame
"""
import click
import os
import pandas as pd
from pandas.io.common import ZipFile
View gist:9ab7d2c6f6dacd794ba16a3c06b3a74b
Verifying that +femtotrader is my blockchain ID. https://onename.com/femtotrader
@femtotrader
femtotrader / web-crawling
Created Oct 1, 2015 — forked from charlesDADI/web-crawling
How make web crawling quickly using python and mongoDB
View web-crawling
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 17 13:56:10 2014
@author: root
"""
import urllib2
opener = urllib2.build_opener()
from bs4 import BeautifulSoup
View digit_version_charles_dadi.py
#http://scikit-learn.org/stable/auto_examples/applications/face_recognition.html#example-applications-face-recognition-py
from sklearn.ensemble import RandomForestClassifier
from numpy import genfromtxt, savetxt
from sklearn import neighbors, datasets
from sklearn.cross_validation import train_test_split
from sklearn.datasets import fetch_lfw_people
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
View FinanceETV
##############################################################
## ##
## VaR and C-VaR computation with ETV on EURUSD ##
## ##
## by Charles-Abner Dadi ##
## ##
## <charles-abner.dadi@graduates.centraliens.net> ##
## ##
##############################################################
@femtotrader
femtotrader / ipython_btc_part1
Created Oct 1, 2015 — forked from charlesDADI/ipython_btc_part1
Art of trading and analyse Bitcoin data_part1
View ipython_btc_part1
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{