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
#!/bin/bash | |
yum repolist all; | |
yum-config-manager --enable codeready-builder-for-rhel-8-rhui-rpms; | |
yum update -y; | |
dd if=/dev/zero of=/swapfile bs=128M count=32; | |
chmod 600 /swapfile; | |
mkswap /swapfile; | |
swapon /swapfile; |
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
#!/bin/bash | |
yum repolist all; | |
yum-config-manager --enable codeready-builder-for-rhel-8-rhui-rpms; | |
yum update -y; | |
dd if=/dev/zero of=/swapfile bs=128M count=32; | |
chmod 600 /swapfile; | |
mkswap /swapfile; | |
swapon /swapfile; |
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
# data: dictionary { 'dd/mm/yyy': price, 'dd/mm/yyyy': price, ... } | |
def movingAverageConvergenceDivergence(data): | |
if not isinstance(data, dict): | |
raise Exception('Dictionary input expected') | |
if (26 > len(data)): | |
raise Exception('Insufficient data for calculation') |
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
# https://whittle.medium.com/trading-using-python-moving-average-convergence-divergence-macd-4dbfee1c1a37 | |
import re | |
import requests | |
from datetime import datetime | |
def cbpGetHistoricRates(market='BTC-GBP', granularity=86400, iso8601start='', iso8601end=''): | |
if not isinstance(market, str): | |
raise Exception('Market string input expected') |
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
# https://whittle.medium.com/trading-using-python-relative-strength-index-rsi-f0c63c1c0db | |
import re | |
import requests | |
from datetime import datetime | |
def cbpGetHistoricRates(market='BTC-GBP', granularity=86400, iso8601start='', iso8601end=''): | |
if not isinstance(market, str): | |
raise Exception('Market string input expected') |
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
# data: dictionary { 'dd/mm/yyy': price, 'dd/mm/yyyy': price, ... } | |
# num: range in the average calculation, normally 9 to 26 | |
def simpleMovingAverage(data, num): | |
if not isinstance(data, dict): | |
raise Exception('Dictionary input expected') | |
if not isinstance(num, int): | |
raise Exception('Integer input expected') | |
if num < 5 or num > 200: |
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
# https://levelup.gitconnected.com/trading-using-python-exponential-moving-average-ema-f38ed3211a44?source=your_stories_page------------------------------------- | |
import re | |
import requests | |
from datetime import datetime | |
def cbpGetHistoricRates(market='BTC-GBP', granularity=86400, iso8601start='', iso8601end=''): | |
if not isinstance(market, str): | |
raise Exception('Market string input expected') |
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
# https://levelup.gitconnected.com/trading-using-python-simple-moving-average-sma-8713caf0d4ee | |
import requests | |
from datetime import datetime | |
# granularity: 60, 300, 900, 3600, 21600, 86400 | |
def cbpGetHistoricRates(market='BTC-GBP', granularity=86400, iso8601start='', iso8601end=''): | |
api = 'https://api.pro.coinbase.com/products/' + market + '/candles?granularity=' + \ |
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 requests | |
from datetime import datetime | |
import matplotlib.pyplot as plt | |
def cbpGetHistoricRates(market='BTC-GBP', granularity=86400, iso8601start='', iso8601end=''): | |
api = 'https://api.pro.coinbase.com/products/' + market + '/candles?granularity=' + \ | |
str(granularity) + '&start=' + iso8601start + '&end=' + iso8601end | |
resp = requests.get(api) | |
if resp.status_code != 200: |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: apache | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: apache | |
# Description: Start apache | |
### END INIT INFO |
OlderNewer