![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
quantative trading
m夏尔
这个作者很懒,什么都没留下…
展开
-
LSTM Trading Strategy
【代码】LSTM Trading Strategy原创 2024-05-16 21:41:01 · 169 阅读 · 0 评论 -
YahooFinanceAPI激活
YFinance API 的免费金融数据api有几个RESTful的endpoints, 曾经工作过,但是今年发现不少中断了,错误提示基本如下:缺少crumb。1)在Chrome里打开:https://query2.finance.yahoo.com/v1/test/getcrumb,得到一个crumb字符串;2)Application::Storage->Cookies 里找到 A1字段的对应值,一般是以"d="开头;原创 2023-11-15 12:05:29 · 289 阅读 · 0 评论 -
资产配置风险计算(Portfolio Risk Analysis)
投资组合风险分析原创 2022-10-07 23:06:08 · 532 阅读 · 0 评论 -
DEX Quote
【代码】DEX Quote。原创 2022-10-03 20:31:52 · 127 阅读 · 0 评论 -
价格时序预测-LSTM
价格时序预测-LSTMLSTM原理LSTM是一种有监督神经网络。在普通的RNN模块里增加一个“短期记忆”模块,使得神经网络能够对基于“很久之前”曾经看到过并重复出现的“时域特征片段”作出预测上的修正。一个简单的应用是利用文本里的相距比较远的“上下文”作更好的文本分析。LSTM是最新的受到广泛应用的有监督神经网络之一。LSTM基本使用原理网络的表达能力(层数&每层节点数)需要和数据量匹配,否则非常容易出现Overfitting。LSTM的“表达能力”非常出众。同时原创 2022-02-06 12:11:23 · 2274 阅读 · 0 评论 -
几何布朗运动 GBM in Python
"""gbm_sim.py"""import numpy as np class GBM(object): ''' classdocs ''' def __init__(self, count_path=10, years=1): S0 = 100. r = 0.05 sigma = 0.50 T = 1 N = 252*years i = count_path原创 2021-10-09 07:39:56 · 795 阅读 · 0 评论 -
Quant Trading Strategy -- HMM
HMM 知乎转载 2021-09-14 10:21:28 · 108 阅读 · 0 评论 -
DL Keras/Tensorflow/Keras-rl/Gym/Python
DL Keras/Tensorflow/Keras-rl/Gym/Python背景环境CartPole背景Keras封装了TensorFlow;Keras-rl封装了Reinforcement Learning这部分的功能;OpenAI Gym则模块化了Tensorflow&Keras里的Environment这个概念,使得“应用和算法隔离”这个思想有了具体的实现,Gym的Env可以直接怼进sKeras/Keras-rl的Agent里。由于TensorFlow的发展到2.0时代,只有Python原创 2021-08-28 14:43:49 · 694 阅读 · 0 评论 -
Algo Trading:简单的等间距网格下单
class SplitPricer(Pricer): def __init__(self, pdesc, bid, ask): super().__init__(pdesc) self.bid = bid self.ask = ask def price(self)->list: lb = self.ask if self.pdesc['LB']=='ASK' else Decimal(self.pdesc['LB'])原创 2020-11-21 19:03:05 · 432 阅读 · 1 评论 -
BTC合约手续费计算
假设:Exit Price = $11000交易所TakerMaker订单名义价值(示例)手续费 (Taker)BMex7.5-2.5$100000.000682 BTCHuobi Futures 反向52$100000.000455 BTCHuobi Futures 正向421BTC$4.4Binance 正向7.57.51BTC$8.25注:表中Taker/Maker费率单位为1bp=1/10000 ,即万分之一(原创 2020-11-02 14:11:04 · 2860 阅读 · 0 评论 -
HFT相关论文
标题内容Risk Metrics and Fine Tuning of High Frequency Trading Strategies, 2012Applied Stochastic Control in High Frequency and Algorithmic Trading, Ph.D. Thesis, 2014Stochastic Control Theory and High Frequency Trading, Knight Capital, 2010...原创 2020-10-20 09:19:56 · 167 阅读 · 0 评论 -
正向合约&反向合约仓位价值变化计算
import pandas as pdp = 10000slr = -0.005 # stop loss tpr = 0.01 # take profitside = -1 # long (1) or short (-1)rows = []# Inverse contractsl = p/(1-side*slr)tp = p/(1-side*tpr)rows += [{'sl': '{:.2f}'.format(sl), 'p0': '{:.2f}'.fo原创 2020-10-18 10:13:53 · 1120 阅读 · 3 评论 -
BMex反向合约盈亏计算
import os,sysimport loggingimport numpy as npimport pandas as pdpd.set_option('display.width', 1000)pd.set_option('display.max_rows', 500)ENTRY = 11440POSITION = -500LEVERAGE = 3FX_RATE_RMB_USD = 6.9WALLET = 0.0978 # BTCSTEP = 10N = 50ST原创 2020-10-14 20:58:50 · 435 阅读 · 1 评论 -
Bracket Order Strategy 止盈止损组合订单策略
All successful trading involves 3 key elements:EdgeSizeVarianceTrading edge relies on either trader’s talent or instinct; size is the amount you wish to invest in a trade; and variance is the market volatility measure. Simplest way (not ideal) of way原创 2020-09-29 11:42:19 · 1210 阅读 · 0 评论