使用EXCEL计算并绘制OBV指标

ANTM股票可视化:Plotly交互+Mplfinance专业K线图实战 股票K线图是金融数据分析的基础可视化形式,其核心在于准确表达价格波动节律与市场情绪变化。原理上需兼顾专业渲染(如红涨绿跌配色、布林带/MA20等指标对齐)与用户交互(悬停查价、缩放聚焦、事件标注)。技术价值体现在将原始OHLCV数据转化为可解释、可操作的决策支持界面,尤其适用于医疗健康等政策敏感型行业。典型应用场景包括财务BP周报、行业研究员趋势归因、CFA学习者实操训练等。本文以ANTM股票为案例,深度融合Plotly交互可视化与Mplfinance专业K线图能力,提供零门槛复现路径。 阅读详情

在本文的底部,各位读者可以获取对应的EXCEL模板。

一、OBV(能量潮指标:On Balance Volume)的含义和原理

OBV指标是由美国投资分析家葛兰碧在1981年创立的,它的理论基础是“能量是因,股价是果”。
每天的交易量跟海水一样的潮起潮落,OBV线方法是将股市的人气,即成交量与股价的关系数字化、以股市的成交量变化来衡量股市的推动力,来研判股价的走势。

二、OBV指标的计算

OBV指标在算法上相当简单,只要根据行情的涨跌来累计市场上每日的成交量即可。
即将上涨日的成交量值视为买进的正值相加,下跌日的成交量则视为卖出的负值减去,依次而得出的涨势与跌势双方动能消长的变化。
即:

  • 如果今天的收盘价高于昨天的收盘价,今天的OBV=昨天OBV+今天的成交量
  • 如果今天的收盘价低于昨天的收盘价,今天的OBV=昨天的OBV-今天的成交量
  • 如果今天的收盘价等于昨日的收盘价,今天的OBV=昨日OBV
三、EXCEL中实现

【数据】表:

  • 股票历史交易数据:来自通达信或者新浪股票
  • E列为收盘价,F列为交易量,G列为OBV指标列,那么
    - 第1天的OBV是第1天的交易量
    - 第2天的OBV由公式= IF(E3 = E2,G2,IF(E3> E2,G2 + F3,G2 – F3))
    - 第3天的OBV由公式= IF(E4 = E3,G3,IF(E4> E3,G3 + F4,G3 – F4))
    - 等等

如下图:

MA、MACD、KDJ、RSI、OBV相关指标计算 z[data1.iloc[1:,5].values-data1.iloc[0:-1,5].values==0]=0 #平。z[data1.iloc[1:,5].values-data1.iloc[0:-1,5].values<0]=-1 #跌。z[data1.iloc[1:,5].values-data1.iloc[0:-1,5].values>=0]=1 #涨。z[data1.iloc[1:,5].values-data1.iloc[0:-1,5].values<0]=-1 #跌。 阅读详情

相关推荐

股票短线交易实盘记录:从1万到100万的高胜率策略解析

短线交易作为股票投资的重要策略,其核心在于通过技术分析和严格纪律实现快速获利。该策略基于市场波动原理,结合趋势判断和动量指标,旨在捕捉短期价格差异带来的收益机会。在技术价值层面,短线交易能够有效提升资金使用效率,通过高频次操作积累复利效应。典型应用场景包括突破交易、回调买入和事件驱动等模式,特别适合波动性较强的市场环境。本文以实盘记录为例,详细展示了全仓操作一只股票的高胜率策略,重点解析了风险控制机制和资金管理方法,其中止损设置和仓位计算是保障策略稳定性的关键要素。通过每日交易日志和绩效统计分析,投资者可以

413

DeepSeek量化选股实操指南:从提示词到通达信公式落地

量化选股是将交易思想转化为可执行、可回测、可验证代码的技术过程。其核心在于理解技术指标原理(如MACD金叉、倍量柱)、掌握金融数据结构(如通达信函数体系、分时均价线定义),并借助大语言模型提升逻辑翻译效率。DeepSeek-V4-Pro因深度适配国内行情语义,在通达信公式生成、多周期嵌套条件表达等方面展现出显著优势,相比通用模型错误率更低、可调试性更强。该方法适用于有交易经验但缺乏编程能力的散户,以及懂Python却难将策略落地的新手,典型应用场景包括尾盘选股、三阶倍量识别、跨周期共振信号构建等。关键不在于

weixin_30906185的博客 505

OBV指标交易策略(累积能量潮与移动能量潮,成交量多空比率净额及相关应用原则)

以东方雨虹为例,计算OBV。Python代码如下: import matplotlib.pyplot as plt difClose = df.Close.diff() difClose[0] = 0 OBV = (((difClose >= 0)*2-1)*Volume).cumsum() OBV = OBV.dropna() OBV.name = ‘OBV’ []( )1.2 移动型OBV 移动型OBV是由累积OBV进行简单移动平均得到,一般选择9日或者12日为时间跨度,移动型OBV的计算公式

sixstar_996的博客 3444

通达信指标公式源码 OBV-分时精准.doc

通达信指标公式源码 OBV-分时精准.doc

Sentence-BERT 语义相似度双塔模型

论文介绍 发表:2019,EMNLP 论文题目:《Sentence-BERT:sentence embeddings using siaese BERT-networks》 论文地址:https://arxiv.org/abs/1908.10084 Github:https://github.com/UKPLab/sentence-transformers 适用领域: 句向量生成 语义相似度计算 语义搜索 无监督任务(聚类) 1 概述 在20年之前的各种预训练模型中,比如bert,XLNet,Alb

weiyaner的博客 9193

逆向工程师的Shopee爬虫避坑指南:af-ac-enc-dat参数生成原理与反反爬策略

本文深入剖析了Shopee电商平台的反爬虫加密机制,重点解析了核心请求头参数x-sap-ri、x-sap-sec及af-ac-enc-dat的生成原理与联动关系。文章从逆向工程视角,提供了定位加密代码、分析算法逻辑的实战方法,并分享了基于JS执行环境模拟与无头浏览器控制的可持续反反爬策略,为高效、稳定地采集数据提供专业指南。

weixin_28607671的博客 1492

Unity Acceleratorc与Cache Server unity的缓存服务器

文章目录1.作用概述2.用法(使用,看这个就够了)服务端下载部署Unity Acceleratorc修改http管理端口修改Editor连接端口客户端使用(设置好一次提交设置,团队拉取即可全部生效)3.测试平台切换测试资源导入测试(打开编辑器的情况下)项目启动测试(不打开编辑器的情况下)4.不同版本表现5.服务端监控6.服务端缓存7.冲突8.预警9.不同项目/不同配置-同种资源10.缓存清除 1.作用概述 编辑器模式下,导入资源,切换平台unity都会重新识别资源,大型项目很浪费时间,使用Cache Ser

euphorias的博客 3812

hdu 1195 Open the Lock(bbfs(双向广搜))

<br />第一次使用双向广搜算法求解,感觉效率的确提高了不止两倍。刚开始的一直WA,后来发现是每次都要扩展一层的节点,然后在扩展另一层的节点,而不是每次只扩展一个节点。<br /> /* Author: ACb0y Date: 2010-9-21 Type: bbfs(双向广搜) ProblemId: hdu 1195 Open the Lock Result: AC */ #include <iostream> #include <queue> using namespace

个人独立博客http://www.acb0y.cn/ 1526

【NVIDIA Jetson Orin系列 - 安装NVIDIA SDK Manager】

NVIDIA Jetson Orin - 安装NVIDIA SDK Manager

dally2的博客 2689

构建面向嵌入式Linux的ARM64交叉编译工具链:从sysroot配置到CMake实战

本文详细介绍了如何构建面向嵌入式Linux的ARM64交叉编译工具链,从sysroot配置到CMake实战。通过分步指导,帮助开发者解决架构不一致问题,提升编译效率,特别适用于树莓派等ARM64设备开发。文章涵盖sysroot机制、环境搭建、CMake配置及常见问题解决方案,是嵌入式开发的实用指南。

weixin_42537142的博客 198

Dify智能体开发:大语言模型(LLM)问题分类

通过定义分类描述,问题分类器能够根据用户输入,使用 LLM 推理与之相匹配的分类并输出分类结果,向下游节点提供更加精确的信息。

王国平的博客 2247

黑猫带你学Nand第8篇:NandFlash的供电情况详解

是指在任何工作条件下,设备允许的最大电压、电流、功率以及温度等参数的界限值。

黑猫奥利奥的博客 1148

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

上一篇: 如何使用Excel绘制砖型图Renko Charts
下一篇: 使用EXCEL计算并绘制KDJ指标
Excel_Quant
博客等级 码龄7年 115粉丝 13原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值