Skip to content

Instantly share code, notes, and snippets.

View trAve3113r's full-sized avatar

Arthur Mwai trAve3113r

  • East Africa,Kenya
View GitHub Profile
import pandas pd
import numpy as np
from pandas import *
# create a dataframe with the last candles bars being an inside_bar pattern
# bullish_candle: close > open
# bearish_candles: open > close
# mother_bar :: open = 70.123 , high =102.634 ,low = 80.021 , close = 97.653
# Notes on the InsidePinBar setup
# inverted__hammer indicates upward price rejection
# bullish/bearish hammer indicate downward price rejection
# *** how do we trade swing_points ??? entry,stop_loss & take_profit ***
# *** rejection of bearish_trend setup ***
# stop_loss --> 1 pip below hammer_pin_bar's 'low' OR (entry - 10 to 20 pips)
# entry -- > 'high' of the hammer_pin_bar ('buy' order)
# take_profit -- > entry + (2*stop_loss) :: won't the 3 next bars swallow up this margin?
# for logging a pesky '500 server error'
# credits :https://stackoverflow.com/questions/238081/how-do-you-log-server-errors-on-django-sites
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
# Include the default Django email handler for errors
# This is what you'd get without configuring logging at all.
'mail_admins': {
"""
Updating http://bit.ly/2nRmaXc to
v2 oanda API
"""
class API(EndPointsMixin,object):
"""updated 'API' class """
def __init__(self,
environment=None,
access_token=None,
headers=None
@trAve3113r
trAve3113r / coding_notes.txt
Last active September 8, 2017 08:05
Bits and pieces i stumble on while surfing the web
Assocation Mining
-------------------
Mlextend can be easily used for finding associations between:
1. Commodities
2. Markets
see links below:
http://rasbt.github.io/mlxtend/USER_GUIDE_INDEX/
http://pbpython.com/market-basket-analysis.html?utm_source=mybridge&utm_medium=blog&utm_campaign=read_more
@trAve3113r
trAve3113r / candlesticks_and_sr_lines.html
Last active September 1, 2017 07:57
A page that displays candlesticks and SR lines with Google Charts via AJAX
<html>
<head>
<title>Google Charts Tutorial</title>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {packages: ['corechart']});
</script>
</head>
<body>
<div id="container" style="width: 550px; height: 400px; margin: 0 auto"></div>
https://www.systutorials.com/docs/linux/man/1-monit/
@trAve3113r
trAve3113r / gist:bf0a6800e53c450f6ebc98b94aa71dca
Created March 19, 2017 20:36 — forked from Atem18/gist:4696071
Tutorial to seting up a django website in production.

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@trAve3113r
trAve3113r / rabbitmq-server-setup.txt
Created March 18, 2017 08:32
Barebones rabbitmq setup for working with Celery on debian
# Installation,see:https://www.rabbitmq.com/install-debian.html
# 1:Execute the following command to add the APT repository to your /etc/apt/sources.list.d:
echo 'deb http://www.rabbitmq.com/debian/ testing main' |
sudo tee /etc/apt/sources.list.d/rabbitmq.list
# 2:(optional) To avoid warnings about unsigned packages, add our public key to your trusted key list using apt-key(8):
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc |
sudo apt-key add -
@trAve3113r
trAve3113r / server_side_tidbits.py
Last active March 13, 2017 19:47
useful DevOps commands
# see debain handbook for admins : https://debian-handbook.info/
# django error: That port is already in use
netstat -lpn | grep: <port_number>
kill -9 <process_id>
# View apache2 errors
cat /var/log/apache2/error.log