Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@aido
aido / _stoploss.py
Last active August 16, 2017 19:51 — forked from prof7bit/_stoploss.py
A simple stop loss bot. Adjust STOP_PRICE and STOP_VOLUME to your needs. The file can be reloaded after editing without restarting goxtool by simply pressing the l key. An update of prof7bit's original _stoploss.py at https://gist.github.com/prof7bit/5437131 to sell entire BTC balance when STOP_VOLUME = 0
"""
a simple stop loss bot.
adjust STOP_PRICE and STOP_VOLUME to your needs.
The file can be reloaded after editing without
restarting goxtool by simply pressing the l key.
"""
import strategy
import goxapi
# pylint: disable=C0301
@aido
aido / _panic.py
Last active December 17, 2015 19:19
A interactive panic bot for goxtool Mt.Gox trading bot framework. Keypress 'b' to execute a buy marketorder with half of local currency balance. Keypress 's' to sell half of BTC balance. Keypress 'v' to execute a buy marketorder with entire local currency balance. Keypress 'a' to sell entire BTC balance. Keypress 'c' to cancel all open orders.
"""
a simple panic bot.
The file can be reloaded after editing without
restarting goxtool by simply pressing the l key.
"""
import strategy
import goxapi
class Strategy(strategy.Strategy):
"""a simple panic bot"""
@aido
aido / _talib.py
Created May 28, 2013 22:01
A simple TA bot for goxtool Mt.Gox trading bot framework making use of the TA-Lib library (http://ta-lib.org) and the Cython based wrapper ta-lib (https://github.com/mrjbq7/ta-lib).
"""
_talib.py
"""
import numpy as np
import talib
import datetime
import strategy
import goxapi
@aido
aido / Polipo-adblocker.sh
Created June 12, 2013 18:01
Use wget and sed to update Polipo forbidden file from http://easylist-downloads.adblockplus.org/easylist.txt
#!/bin/bash +xv
declare WGET=/usr/bin/wget
declare SED=/bin/sed
declare INVOKE=/usr/sbin/invoke-rc.d
#declare TORIFY=/usr/bin/torify
#declare TORRESOLVE=/usr/bin/tor-resolve
declare -i EXIT_VALUE=0
@aido
aido / _startgain.py
Created June 16, 2013 17:59
A simple start gain bot. Adjust START_PRICE and START_VOLUME to your needs. The file can be reloaded after editing without restarting goxtool by simply pressing the l key. An update of prof7bit's original _stoploss.py at https://gist.github.com/prof7bit/5437131 to buy entire USD (or EUR etc.) balance when START_VOLUME = 0
"""
a simple start gain bot.
adjust START_PRICE and START_VOLUME to your needs.
The file can be reloaded after editing without
restarting goxtool by simply pressing the l key.
"""
import strategy
import goxapi
# pylint: disable=C0301
@aido
aido / 0_reuse_code.js
Created February 8, 2014 01:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aido
aido / DER_test
Last active August 29, 2015 13:57
A DER decode test for OpenSSL and PolarSSL
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <openssl/ec.h>
#include <openssl/ecdsa.h>
#include <openssl/obj_mac.h>
#include <polarssl/entropy.h>
#include <polarssl/ctr_drbg.h>
#include <polarssl/pk.h>
Tick: 3
??.??.??(?,?)??:??:255 MEZ 0,0 0 p(0-0:0) s(6-4:0) m(0-0:0) h(0-0:0) wd(0-0:0) D(0-0:0) M(0-0:0) Y(0-0:0) 0,0,0,255
Clock state: useless
Tick: 7
??.??.??(?,?)??:??:255 MEZ 0,0 0 p(30-0:3) s(6-4:0) m(0-0:0) h(0-0:0) wd(0-0:0) D(0-0:0) M(0-0:0) Y(0-0:0) 0,0,0,255
Clock state: useless
Tick: 9
??.??.??(?,?)??:??:255 MEZ 0,0 0 p(60-4:7) s(4-4:0) m(0-0:0) h(0-0:0) wd(0-0:0) D(0-0:0) M(0-0:0) Y(0-0:0) 0,0,0,255
Clock state: useless
Tick: 13
00 AKAKAKAKAKAKAKAKAKAKAKHDKAKAKAKAKAKAKAKAKAKAKABJAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAK
01 AKAKAKAKAKAKAKAKAKAKBJKAKAKAKAKAKAKAKAKAKAKAJBAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAK
02 AKAKAKAKAKAKAKAKAKAKAKICKAKAKAKAKAKAKAKAKAKAGEAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAK
03 AKAKAKAKAKAKAKAKAKAKAKJBKAKAKAKAKAKAKAKAKAKAGEAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAK
04 AKAKAKAKAKAKAKAKAKAKAKHDKAKAKAKAKAKAKAKAKAKAICAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKAK
05 A
@aido
aido / check_web_update.sh
Last active May 19, 2016 16:32
Using only Bash built-ins send an IFTTT notification when a webpage is updated
#!/bin/bash
declare -r CHECK_HOST=www.mtgox.com
declare -r CHECK_RESOURCE=/
declare -r IFTTT_EVENT=MtGOX
declare -r IFTTT_KEY=<CHANGE ME>
declare -r IFTTT_HOST=maker.ifttt.com
declare -r IFTT_RESOURCE=/trigger/${IFTTT_EVENT}/with/key/${IFTTT_KEY}
declare -r IFTT_REQUEST="HEAD ${IFTT_RESOURCE} HTTP/1.1\r\nHost: ${IFTTT_HOST}\r\nConnection: Close\r\n\r\n"