Skip to content

Instantly share code, notes, and snippets.

View buddies2705's full-sized avatar
🏠
Working from home

Gaurav buddies2705

🏠
Working from home
  • Bangalore
View GitHub Profile
[
{
"product_code": "BTC_JPY"
},
{
"product_code": "FX_BTC_JPY"
},
{
"product_code": "ETH_BTC"
},
@buddies2705
buddies2705 / balance.py
Created June 10, 2020 02:06
Get bitFlyer Balance
import requests
import json
import time
import hmac
import hashlib
import base64
API_ENDPOINT = 'https://api.bitflyer.com'
@buddies2705
buddies2705 / markets.py
Created June 10, 2020 02:04
Get bitFlyer Markets
import requests
import json
API_ENDPOINT = 'https://api.bitflyer.com'
def convetStrToJson(str):
return json.loads(str)
@buddies2705
buddies2705 / bitFlyerTicker.py
Created June 10, 2020 02:01
Python script for bitFlyer Ticker
import requests
import json
API_ENDPOINT = 'https://api.bitflyer.com'
def convetStrToJson(str):
return json.loads(str)
@buddies2705
buddies2705 / optimiser.py
Created May 28, 2020 22:02
Strategy Optimiser
import itertools
from pyalgotrade.optimizer import local
from accumulator import Accumulator
from pyalgotrade.bar import Frequency
from pyalgotrade.barfeed import csvfeed
import multiprocessing
multiprocessing.set_start_method('spawn', True)
def parameters_generator():
instrument = ["BTC"]
from pyalgotrade import strategy
from pyalgotrade.bar import Frequency
from pyalgotrade.barfeed import csvfeed
from pyalgotrade.stratanalyzer import returns
from pyalgotrade.stratanalyzer import trades
from pyalgotrade import plotter
from accumulator import Accumulator
@buddies2705
buddies2705 / accumulator.py
Last active May 29, 2020 00:08
Strategy Accumulator
from __future__ import print_function
from pyalgotrade import strategy
from pyalgotrade.barfeed import quandlfeed, csvfeed
from pyalgotrade.technical import ma
class Accumulator(strategy.BacktestingStrategy):
def __init__(self, feed, instrument, buy_offset, buy_percent):
super(Accumulator, self).__init__(feed, 90000)
@buddies2705
buddies2705 / bitflyer-fetch-ohlcv-to-csv.py
Created May 28, 2020 21:56
Fetching Bitflyer ohlcv data
# -*- coding: utf-8 -*-
import os
import sys
import csv
import pandas as pd
import datetime
# -----------------------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Promise Dapp</title>
<script src="./node_modules/web3/dist/web3.min.js"></script>
<!-- node_modules/web3/dist/web3.min.js -->
</head>
module.exports = {
networks: {
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
},
},