Source:
currency strength dashbaord.docxExtracted: 2026-05-20
| #Here's a full example of Perry Kaufman's market efficiency strategy implemented in Python, including backtesting capabilities | |
| #using historical data. Remember that this is a simplified example for educational purposes, and it does not include considerations | |
| #such as transaction costs or slippage. | |
| pip install pandas numpy yfinance matplotlib | |
| import pandas as pd | |
| import numpy as np | |
| import yfinance as yf | |
| import matplotlib.pyplot as plt |
| aiohappyeyeballs==2.4.6 | |
| aiohttp==3.11.13 | |
| aiosignal==1.3.2 | |
| altair==5.5.0 | |
| annotated-types==0.7.0 | |
| anyio==4.8.0 | |
| appnope==0.1.4 | |
| argon2-cffi==23.1.0 | |
| argon2-cffi-bindings==21.2.0 | |
| arrow==1.3.0 |
This is the first time we’re integrating an exchange on the Mixin network into CCXT, but the process is actually more straightforward than expected.
CCXT started as an SDK to simplify connecting to various centralized exchanges. However, with the recent addition of Hyperliquid—a decentralized exchange on an EVM network—CCXT is expanding its reach, paving the way for more DEX integrations across different networks.
To add a new exchange to CCXT, we create a file under /ts/src/ named [exchange-name].ts. This file defines the methods available when initializing an instance of the exchange. It inherits the base class in /ts/src/base/Exchange.ts, which contains all possible methods for an exchange. We implement only the necessary ones for the new exchange in the new file.
| import numpy as np | |
| import cvxpy as cp | |
| import itertools | |
| # Problem data | |
| global_indices = list(range(4)) | |
| # 0 = TOKEN-0 | |
| # 1 = TOKEN-1 | |
| # 2 = TOKEN-2 |
| So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear! | |
| Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy. | |
| * Off the top of my head * | |
| 1. Fork their repo on Github | |
| 2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it | |
| git remote add my-fork git@github...my-fork.git |
| # https://www.quantopian.com/posts/technical-analysis-indicators-without-talib-code | |
| import numpy | |
| import pandas as pd | |
| import math as m | |
| #Moving Average | |
| def MA(df, n): | |
| MA = pd.Series(pd.rolling_mean(df['Close'], n), name = 'MA_' + str(n)) | |
| df = df.join(MA) |
| curl 'https://finance.vietstock.vn/derivatives/cwtradinginfo' \ | |
| -X 'POST' \ | |
| -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \ | |
| -H 'Accept: */*' \ | |
| -H 'Accept-Language: en-us' \ | |
| -H 'Accept-Encoding: gzip, deflate, br' \ | |
| -H 'Host: finance.vietstock.vn' \ | |
| -H 'Origin: https://finance.vietstock.vn' \ | |
| -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Safari/605.1.15' \ | |
| -H 'Connection: keep-alive' \ |
| import pandas as pd | |
| def _map_to_pandas(rdds): | |
| """ Needs to be here due to pickling issues """ | |
| return [pd.DataFrame(list(rdds))] | |
| def toPandas(df, n_partitions=None): | |
| """ | |
| Returns the contents of `df` as a local `pandas.DataFrame` in a speedy fashion. The DataFrame is | |
| repartitioned if `n_partitions` is passed. |
| #!/usr/bin/env python3 | |
| import os | |
| import re | |
| import logging | |
| import click | |
| # don't index these | |
| excludes = { | |
| 'single_files', | |
| 'Icon', |