Skip to content

Instantly share code, notes, and snippets.

View webclinic017's full-sized avatar
💭
I may be slow to respond.

WebClinic webclinic017

💭
I may be slow to respond.
View GitHub Profile
@webclinic017
webclinic017 / EKSvsEC2.md
Created July 25, 2023 00:25 — forked from mbstacy/EKSvsEC2.md
EKS vs EC2 Kubernetes Costs

Kubernetes Cost Comparison EC2 vs EKS

EKS Kubernetes

AWS EKS service provides the Kubernetes control plane. Price for EKS Service is $0.20 per hour / cluster.

EKS Use Case Monthly Cost

Three clusters with four worker nodes.

from aiohttp import ClientSession, TCPConnector
import asyncio
import sys
import pypeln as pl
limit = 1000
urls = ("http://localhost:8080/{}".format(i) for i in range(int(sys.argv[1])))
@webclinic017
webclinic017 / zeromq-vs-redis.md
Created September 30, 2021 19:15 — forked from hmartiro/zeromq-vs-redis.md
Comparison of ZeroMQ and Redis for a robot control platform

ZeroMQ vs Redis

This document is research for the selection of a communication platform for robot-net.

Goal

The purpose of this component is to enable rapid, reliable, and elegant communication between the various nodes of the network, including controllers, sensors, and actuators (robot drivers). It will act as the core of robot-net to create a standardized infrastructure for robot control.

Requirements:

#####################################################################################
# Strategy - Shorting at High #
#####################################################################################
# Upload the libraries and make other initial settings ##########################################################################################
library(xlsx);library(zoo);library(quantmod);library(rowr);library(TTR);
system.time({
@webclinic017
webclinic017 / GenerateOptimalPortfolioWeights.py
Created August 22, 2021 12:07 — forked from Doggie52/GenerateOptimalPortfolioWeights.py
Financial portfolio optimizer (Sharpe/Vol/CVaR) with Bayesian shrinkage and filtering
def GenerateOptimalPortfolioWeights(returnsDf):
###########################################
# GENERATE MATRICES
# - CALCULATING RETURNS, VOLS AND DVOLS
# Populate annual returns
assetsReturn = []
for assetName in returnsDf:
assetReturn = returnsDf[assetName].add(1).product() - 1
"""
Place this file into into `user_data/hyperopts`.
Run hyperopt:
$ freqtrade -c your/config.json --strategy-path user_data/hyperopts/ -s CombinedBinHAndClucSupertrendOpts6Mixin hyperopt --customhyperopt CombinedBinHAndClucSupertrendOpts6 --hyperopt-loss OnlyProfitHyperOptLoss --min-trades 3 --print-all --random-state 333 -e 1000
$ freqtrade -c your/config.json --strategy-path user_data/hyperopts/ -s CombinedBinHAndClucSupertrendOpts6Mixin hyperopt --customhyperopt CombinedBinHAndClucSupertrendOpts6 --hyperopt-loss OnlyProfitHyperOptLoss --min-trades 3 --print-all --random-state 333 -e 1000 --space roi stoploss
The `--min-trades 3 --print-all --random-state 333 -e 1000 --space roi stoploss` part is optional here, just for illustration.
Run backtesting:
$ freqtrade -c your/config.json --strategy-path user_data/hyperopts/ -s CombinedBinHAndClucSupertrendOpts6Mixin backtesting
# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement
import talib.abstract as ta
from pandas import DataFrame
import freqtrade.vendor.qtpylib.indicators as qtpylib
from freqtrade.strategy.interface import IStrategy
class IsNotItTheHolyGrailManStrategy(IStrategy):
@webclinic017
webclinic017 / main.py
Created July 22, 2021 23:02 — forked from f0ster/main.py
quantconnect wheel strategy example
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/* Done by Rajandran R */
/* Author of www.marketcalls.in */
/* Date : 05th Apr 2016 */
function GetSecondNum()
{
Time = Now( 4 );
Seconds = int( Time % 100 );
Minutes = int( Time / 100 % 100 );
Hours = int( Time / 10000 % 100 );
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway: