基于macd、kdj、ma技术指标分析股票多空方向——应用开发4 分析技术指标一系列形态结果

article/2025/9/19 8:41:13

接上一节,我们计算获取了技术指标的结果total_df,结果如下图

我们需要显示股票最近10天的分析结果,对此我们只需要截取total_df前12天数据就可以了。

#获取前12天的数据
total_df=total_df.iloc[-12:,:]

total_df 对应列的数字0~9,待会作数据分析时用得上

 我们要初始一个储存分析结果的数据,要包含日期、技术指标结果、收盘价

result_df = pd.DataFrame(columns=['日期','MACD','KDJ','均线','收盘价'])

用for循环遍历把被分析天的数据与其前一天的数据作比较 

for i in range(2,len(total_df)):

把每做完一次分析要把total_df日期与收盘价赋予给result_df对应列 

result_df = pd.DataFrame(columns=['日 期','MACD','KDJ','均线','收盘价'])for i in range(2,len(total_df)):date= toatal_df.index[i].strftime('%Y-%m-%d')result_df.loc[i,'日 期'] = dateresult_df.loc[i,'收盘价'] = total_df.iloc[i,9]

基于MACD形态分析

例子:低位金叉

原理:

如果 total_df[ t-1 , 0 ] < total_df[ t-1 , 2 ] & total_df[ t0 , 0 ]>total[ t0 , 2 ] & total_df[ t-1 , 1 ] < 0 & total_df[ t0 , 1 ] > 0 结果为 真(True),result_df[ t0 , MACD ] 赋值为 低位金叉

#MACD形态分析
if total_df.iloc[i-1,0]<total_df.iloc[i-1,2] and total_df.iloc[i,0]>total_df.iloc[i,2] and total_df.iloc[i-1,1]<0 and total_df.iloc[i,1]>0:result_df.loc[i,'MACD']='低位金叉'

同理可得MACD其余形态分析:

#MACD形态分析
if total_df.iloc[i-1,0]<total_df.iloc[i-1,2] and total_df.iloc[i,0]>total_df.iloc[i,2] and total_df.iloc[i-1,1]<0 and total_df.iloc[i,1]>0:result_df.loc[i,'MACD']='低位金叉'
elif total_df.iloc[i-1,0]<total_df.iloc[i-1,2] and total_df.iloc[i,0]>total_df.iloc[i,2]:result_df.loc[i,'MACD']='金叉'
elif total_df.iloc[i-1,0]>0 and total_df.iloc[i-1,2]>0 and total_df.iloc[i,0]>0 and total_df.iloc[i,2]>0 and total_df.iloc[i-1,0]>total_df.iloc[i-1,2] and total_df.iloc[i,0]<total_df.iloc[i,2] and total_df.iloc[i-1,1]>0 and total_df.iloc[i,1]<0:result_df.loc[i,'MACD']='高位死叉'
elif total_df.iloc[i-1,0]>total_df.iloc[i-1,2] and total_df.iloc[i,0]<total_df.iloc[i,2]:result_df.loc[i,'MACD']='死叉'
elif total_df.iloc[i-1,0]<0 and total_df.iloc[i,0]>0:result_df.loc[i,'MACD']='DIF上穿0轴'
else:result_df.loc[i,'MACD']='中性'

基于KDJ形态分析

#KDJ形态分析
if total_df.iloc[i-1,3]<total_df.iloc[i-1,4] and total_df.iloc[i,3]>total_df.iloc[i,4] and total_df.iloc[i,3]<20 and total_df.iloc[i,4]<20 and total_df.iloc[i,5]<20:result_df.loc[i,'KDJ']='低位金叉'
elif total_df.iloc[i-1,3]<total_df.iloc[i-1,4] and total_df.iloc[i,3]>total_df.iloc[i,4]:result_df.loc[i,'KDJ']='金叉'
elif total_df.iloc[i-1,3]>total_df.iloc[i-1,4] and total_df.iloc[i,3]<total_df.iloc[i,4] and total_df.iloc[i,3]>50 and total_df.iloc[i,4]>50 and total_df.iloc[i,5]>50:result_df.loc[i,'KDJ']='高位死叉'
elif total_df.iloc[i-1,3]>total_df.iloc[i-1,4] and total_df.iloc[i,3]<total_df.iloc[i,4]:result_df.loc[i,'KDJ']='死叉'
elif total_df.iloc[i-1,5]<0 and total_df.iloc[i,5]>0:result_df.loc[i,'KDJ']='J线上穿0轴'
elif total_df.iloc[i-1,5]>90 and total_df.iloc[i,5]>90 and total_df.iloc[i-1,5]>total_df.iloc[i,5]:result_df.loc[i,'KDJ']='适当减仓'
elif total_df.iloc[i-1,5]<20 and total_df.iloc[i,5]<20 and total_df.iloc[i-1,5]<total_df.iloc[i,5]:result_df.loc[i,'KDJ']='适当关注'
else:result_df.loc[i,'KDJ']='中性'

基于均线形态分析

#定义判断均线多种形态函数
if total_df.iloc[i-1,6]<total_df.iloc[i-1,7] and total_df.iloc[i,6]>total_df.iloc[i,7]:result_df.loc[i,'均线']='5交10金叉'
elif total_df.iloc[i-1,6]<total_df.iloc[i-1,8] and total_df.iloc[i,6]>total_df.iloc[i,8]:result_df.loc[i,'均线']='5交20金叉'
elif total_df.iloc[i-1,6]>total_df.iloc[i-1,7] and total_df.iloc[i,6]<total_df.iloc[i,7]:result_df.loc[i,'均线']='5交10死叉'
elif total_df.iloc[i-1,6]>total_df.iloc[i-1,8] and total_df.iloc[i,6]<total_df.iloc[i,8]:result_df.loc[i,'均线']='5交20死叉'
elif total_df.iloc[i-2,6]<total_df.iloc[i-1,6] and total_df.iloc[i-1,6]>total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线向下拐'
elif total_df.iloc[i-2,6]>total_df.iloc[i-1,6] and total_df.iloc[i-1,6]<total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线向上拐'
elif total_df.iloc[i,9]>total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线上'
elif total_df.iloc[i,9]<total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线下'

最后result_df 输出结果

将代码封装在get_analyse函数里,实现result_df=get_analyse(total_df)

def get_analyse(total_df):result_df = pd.DataFrame(columns=['日期','MACD','KDJ','均线','收盘价'])for i in range(2,len(total_df)):date= total_df.index[i].strftime('%Y-%m-%d')result_df.loc[i,'日 期'] = dateresult_df.loc[i,'收盘价'] = total_df.iloc[i,9]#MACD形态分析if total_df.iloc[i-1,0]<total_df.iloc[i-1,2] and total_df.iloc[i,0]>total_df.iloc[i,2] and total_df.iloc[i-1,1]<0 and total_df.iloc[i,1]>0:result_df.loc[i,'MACD']='低位金叉'elif total_df.iloc[i-1,0]<total_df.iloc[i-1,2] and total_df.iloc[i,0]>total_df.iloc[i,2]:result_df.loc[i,'MACD']='金叉'elif total_df.iloc[i-1,0]>0 and total_df.iloc[i-1,2]>0 and total_df.iloc[i,0]>0 and total_df.iloc[i,2]>0 and total_df.iloc[i-1,0]>total_df.iloc[i-1,2] and total_df.iloc[i,0]<total_df.iloc[i,2] and total_df.iloc[i-1,1]>0 and total_df.iloc[i,1]<0:result_df.loc[i,'MACD']='高位死叉'elif total_df.iloc[i-1,0]>total_df.iloc[i-1,2] and total_df.iloc[i,0]<total_df.iloc[i,2]:result_df.loc[i,'MACD']='死叉'elif total_df.iloc[i-1,0]<0 and total_df.iloc[i,0]>0:result_df.loc[i,'MACD']='DIF上穿0轴'else:result_df.loc[i,'MACD']='中性'#KDJ形态分析if total_df.iloc[i-1,3]<total_df.iloc[i-1,4] and total_df.iloc[i,3]>total_df.iloc[i,4] and total_df.iloc[i,3]<20 and total_df.iloc[i,4]<20 and total_df.iloc[i,5]<20:result_df.loc[i,'KDJ']='低位金叉'elif total_df.iloc[i-1,3]<total_df.iloc[i-1,4] and total_df.iloc[i,3]>total_df.iloc[i,4]:result_df.loc[i,'KDJ']='金叉'elif total_df.iloc[i-1,3]>total_df.iloc[i-1,4] and total_df.iloc[i,3]<total_df.iloc[i,4] and total_df.iloc[i,3]>50 and total_df.iloc[i,4]>50 and total_df.iloc[i,5]>50:result_df.loc[i,'KDJ']='高位死叉'elif total_df.iloc[i-1,3]>total_df.iloc[i-1,4] and total_df.iloc[i,3]<total_df.iloc[i,4]:result_df.loc[i,'KDJ']='死叉'elif total_df.iloc[i-1,5]<0 and total_df.iloc[i,5]>0:result_df.loc[i,'KDJ']='J线上穿0轴'elif total_df.iloc[i-1,5]>90 and total_df.iloc[i,5]>90 and total_df.iloc[i-1,5]>total_df.iloc[i,5]:result_df.loc[i,'KDJ']='适当减仓'elif total_df.iloc[i-1,5]<20 and total_df.iloc[i,5]<20 and total_df.iloc[i-1,5]<total_df.iloc[i,5]:result_df.loc[i,'KDJ']='适当关注'else:result_df.loc[i,'KDJ']='中性'#定义判断均线多种形态函数if total_df.iloc[i-1,6]<total_df.iloc[i-1,7] and total_df.iloc[i,6]>total_df.iloc[i,7]:result_df.loc[i,'均线']='5交10金叉'elif total_df.iloc[i-1,6]<total_df.iloc[i-1,8] and total_df.iloc[i,6]>total_df.iloc[i,8]:result_df.loc[i,'均线']='5交20金叉'elif total_df.iloc[i-1,6]>total_df.iloc[i-1,7] and total_df.iloc[i,6]<total_df.iloc[i,7]:result_df.loc[i,'均线']='5交10死叉'elif total_df.iloc[i-1,6]>total_df.iloc[i-1,8] and total_df.iloc[i,6]<total_df.iloc[i,8]:result_df.loc[i,'均线']='5交20死叉'elif total_df.iloc[i-2,6]<total_df.iloc[i-1,6] and total_df.iloc[i-1,6]>total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线向下拐'elif total_df.iloc[i-2,6]>total_df.iloc[i-1,6] and total_df.iloc[i-1,6]<total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线向上拐'elif total_df.iloc[i,9]>total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线上'elif total_df.iloc[i,9]<total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线下'return result_df

完整代码

import tushare as ts
import pandas as pd
import datetime
import pandas_ta as tatoken='你的token'
ts.set_token(token)
pro=ts.pro_api()def get_stock(num):stocknum=numtoday = datetime.datetime.today()startday=today+datetime.timedelta(days=-365)today = today.strftime('%Y%m%d')startday =startday.strftime('%Y%m%d')stock_df= pro.daily(ts_code=stocknum, start_date=startday,end_date=today)stock_df['trade_date'] = pd.to_datetime(stock_df['trade_date'])stock_df.set_index('trade_date',inplace=True)stock_df=stock_df.rename(columns={'vol':'volume'})stock_df=stock_df.iloc[::-1]return stock_dfdef get_technical(stock_df):#MACDmacd_df = ta.macd(stock_df['close'])#KDJkdj_df = ta.kdj(stock_df['high'],stock_df['low'],stock_df['close'])#均线 5、10、20天ma5_df = pd.DataFrame(ta.sma(stock_df['close'],length=5))ma10_df = pd.DataFrame(ta.sma(stock_df['close'],length=10))ma20_df = pd.DataFrame(ta.sma(stock_df['close'],length=20))#连接所有技术指标结果与收盘价以列形式在一个DataFrametotal_df = pd.concat([macd_df,kdj_df,ma5_df,ma10_df,ma20_df,stock_df['close']],axis=1)#获取前12天的数据total_df=total_df.iloc[-12:,:]return macd_df,kdj_df,ma5_df,ma10_df,ma20_df,total_dfdef get_analyse(total_df):result_df = pd.DataFrame(columns=['日期','MACD','KDJ','均线','收盘价'])for i in range(2,len(total_df)):date= total_df.index[i].strftime('%Y-%m-%d')result_df.loc[i,'日 期'] = dateresult_df.loc[i,'收盘价'] = total_df.iloc[i,9]#MACD形态分析if total_df.iloc[i-1,0]<total_df.iloc[i-1,2] and total_df.iloc[i,0]>total_df.iloc[i,2] and total_df.iloc[i-1,1]<0 and total_df.iloc[i,1]>0:result_df.loc[i,'MACD']='低位金叉'elif total_df.iloc[i-1,0]<total_df.iloc[i-1,2] and total_df.iloc[i,0]>total_df.iloc[i,2]:result_df.loc[i,'MACD']='金叉'elif total_df.iloc[i-1,0]>0 and total_df.iloc[i-1,2]>0 and total_df.iloc[i,0]>0 and total_df.iloc[i,2]>0 and total_df.iloc[i-1,0]>total_df.iloc[i-1,2] and total_df.iloc[i,0]<total_df.iloc[i,2] and total_df.iloc[i-1,1]>0 and total_df.iloc[i,1]<0:result_df.loc[i,'MACD']='高位死叉'elif total_df.iloc[i-1,0]>total_df.iloc[i-1,2] and total_df.iloc[i,0]<total_df.iloc[i,2]:result_df.loc[i,'MACD']='死叉'elif total_df.iloc[i-1,0]<0 and total_df.iloc[i,0]>0:result_df.loc[i,'MACD']='DIF上穿0轴'else:result_df.loc[i,'MACD']='中性'#KDJ形态分析if total_df.iloc[i-1,3]<total_df.iloc[i-1,4] and total_df.iloc[i,3]>total_df.iloc[i,4] and total_df.iloc[i,3]<20 and total_df.iloc[i,4]<20 and total_df.iloc[i,5]<20:result_df.loc[i,'KDJ']='低位金叉'elif total_df.iloc[i-1,3]<total_df.iloc[i-1,4] and total_df.iloc[i,3]>total_df.iloc[i,4]:result_df.loc[i,'KDJ']='金叉'elif total_df.iloc[i-1,3]>total_df.iloc[i-1,4] and total_df.iloc[i,3]<total_df.iloc[i,4] and total_df.iloc[i,3]>50 and total_df.iloc[i,4]>50 and total_df.iloc[i,5]>50:result_df.loc[i,'KDJ']='高位死叉'elif total_df.iloc[i-1,3]>total_df.iloc[i-1,4] and total_df.iloc[i,3]<total_df.iloc[i,4]:result_df.loc[i,'KDJ']='死叉'elif total_df.iloc[i-1,5]<0 and total_df.iloc[i,5]>0:result_df.loc[i,'KDJ']='J线上穿0轴'elif total_df.iloc[i-1,5]>90 and total_df.iloc[i,5]>90 and total_df.iloc[i-1,5]>total_df.iloc[i,5]:result_df.loc[i,'KDJ']='适当减仓'elif total_df.iloc[i-1,5]<20 and total_df.iloc[i,5]<20 and total_df.iloc[i-1,5]<total_df.iloc[i,5]:result_df.loc[i,'KDJ']='适当关注'else:result_df.loc[i,'KDJ']='中性'#定义判断均线多种形态函数if total_df.iloc[i-1,6]<total_df.iloc[i-1,7] and total_df.iloc[i,6]>total_df.iloc[i,7]:result_df.loc[i,'均线']='5交10金叉'elif total_df.iloc[i-1,6]<total_df.iloc[i-1,8] and total_df.iloc[i,6]>total_df.iloc[i,8]:result_df.loc[i,'均线']='5交20金叉'elif total_df.iloc[i-1,6]>total_df.iloc[i-1,7] and total_df.iloc[i,6]<total_df.iloc[i,7]:result_df.loc[i,'均线']='5交10死叉'elif total_df.iloc[i-1,6]>total_df.iloc[i-1,8] and total_df.iloc[i,6]<total_df.iloc[i,8]:result_df.loc[i,'均线']='5交20死叉'elif total_df.iloc[i-2,6]<total_df.iloc[i-1,6] and total_df.iloc[i-1,6]>total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线向下拐'elif total_df.iloc[i-2,6]>total_df.iloc[i-1,6] and total_df.iloc[i-1,6]<total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线向上拐'elif total_df.iloc[i,9]>total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线上'elif total_df.iloc[i,9]<total_df.iloc[i,6]:result_df.loc[i,'均线']='5天线下'return result_dfget_stocknum =pd.read_excel('股票代码.xlsx')
stock_df = get_stock(get_stocknum.iloc[0,0])
macd_df,kdj_df,ma5_df,ma10_df,ma20_df,total_df=get_technical(stock_df)
result_df=get_analyse(total_df)


http://chatgpt.dhexx.cn/article/0Ec2FvJj.shtml

相关文章

波段炒股看什么指标最准,怎么才能把股票波段做好?

波段炒股看什么指标最准&#xff0c;怎么才能把股票波段做好&#xff1f;股票有不少盈利方式&#xff0c;可是这样的盈利方式&#xff0c;你会吗&#xff1f;做波段盈利的好处在哪里呢&#xff1f; 股票做波段赢利率&#xff0c;针对股票市场的波段操作特点&#xff0c;波段操作…

基于macd、kdj、ma技术指标分析股票多空方向——应用开发3 计算股票相关技术指标数据

接上一节&#xff0c;我们获取了000001.SZ股票过去一年的历史数据stock_df&#xff0c;接下来我们就计算技术指标 所用包 pandas_ta import pandas_ta as ta 关于pandas_ta 可以在GitHub - twopirllc/pandas-ta: Technical Analysis Indicators - Pandas TA is an easy to …

股票 - - 常用指标【下】

股票 - - 常用指标【下】 接上一篇文章,文章地址&#xff1a;八、巴菲特最看重的指标1. 简介 九、快速读懂股票的估值1.前言2.市盈率3.知识点 十、筹码分布 - - 一个一用就上瘾的指标1.一个关于筹码的故事2.关于筹码的形态单峰密集状态双峰密集状态多峰密集形态 3.上述三种形态…

常用技术指标之一文读懂KDJ指标

什么是KDJ指标&#xff1f; KDJ中文名又叫随机指标&#xff0c;英文名叫Stochastic oscillator&#xff0c;由乔治莱恩&#xff08;George Lane&#xff09;于20世纪50年代首创&#xff0c;最早用于期货市场。KDJ指标能比较迅速、直观地研判行情&#xff0c;主要用于分析中短期…

史上最全股票指标图文详解(原创)

炒股要把风险放在第一位,盈利放在第二位。 1、成交量(VOL)指标: 定义:股市中的成交量,是指股票或者大盘当日成交量的总手数。成交量指标一般是用柱状图来表示。左面的坐标值与柱子的横向对应处,就是当日当时的成交总手。如当天收盘价高于当天开盘价,成交柱呈红色;…

期货投资心得

期货的K线是什么 K线就是股票期货某个时间段的价格趋势&#xff0c;有四个数据构成&#xff0c;一个是开盘价&#xff0c;收盘价&#xff0c;最高价&#xff0c;最低价。其中k线红色时表示&#xff0c;收盘价高于收盘价&#xff1b;其中k线绿色时表示&#xff0c;收盘价低于收…

量化分析(8)——唐安奇通道

唐安奇通道和布林通道差不多&#xff0c;都是判断超买和超卖的工具&#xff0c;我还是喜欢rsi强度来判断超买和超卖&#xff0c;不过这二者可以相互印证一下。这里简单的画一下图&#xff0c;介绍一下。 # -*- coding: utf-8 -*- """ Created on Thu Oct 19 11…

Python 金融量化 道路突破策略(唐奇安道路突破策略布林带通道及其市场风险)

目录 获取数据1.通道突破简介2.唐奇安通道(Donchian Channel)2.1 唐奇安通道刻画2.2 在K线图中绘制唐奇安上下通道线2.3 Python捕捉唐奇安通道突破2.4 选择不同时间跨度 3.布林带通道3.1 布林带通道概述3.2布林带通道计算方式3.3 开始编码3.4 布林带通道线及K线图绘制3.5 布林带…

常用技术指标之一文读懂BOLL布林线指标

什么是布林线指标&#xff1f; 布林线BOLL指标(Bollinger Bands)是股市技术分析的常用工具之一&#xff0c;由美国金融分析师John Bollinger根据移动平均线和统计学中的标准差原理于1980年代设计出来。 如上图所示&#xff0c;布林线指标由上、中、下三条轨线组成&#xff0c;…

Python绘制BOLL布林线指标图

写在前面布林线&#xff08;BOLL&#xff09;技术指标简介BOLL公式详解参数设置 用到的主要Python库Python代码&详解参考文献推荐阅读 写在前面 本文代码部分总结自Packt出版社的《Learn Algorithmic Trading - Fundamentals of Algorithmic Trading》&#xff08;图1&…

Boll布林带突破策略

1.策略原理 一个很简单的策略 突破上轨&#xff0c;且Rsi没有超卖时做多&#xff0c;价格回归中轨时平仓 代码&#xff1a; seting {name: BB, symbol: ETHUSDT, kTime: 15m, bb_len: 129, bb_mult: 2.259, rsi_len: 22, rsi_long_min: 15, rsi_long_max: 76, rsi_short_mi…

布林带-BOLL (Bollinger Band)

也叫布林通道。 一般价格的波动是在一定的区间内的&#xff0c;区间的宽度代表价格的变动幅度&#xff0c;越宽表示价格变动幅度越大&#xff0c;越窄表示价格变动幅度越小。 布林带由支撑线(LOWER)、阻力线(UPER) 和中线(MID) 三者组成。 价格突破阻力线/支撑线,表示卖出/买入…

如何利用布林带构建量化交易策略?

布林带之于交易就像莎士比亚之于文学&#xff0c;如果你想在交易世界中留下印记&#xff0c;这非常重要而且很难避免。布林带是一种技术指标&#xff0c;用于以更好的方式分析市场并帮助我们对资产价格做出更好的假设&#xff0c;即资产是否超买或超卖。 布林带实际上由三个波…

量化进阶—— 高胜算交易策略(布林线)

阅读原文&#xff1a;京东量化平台-为投资者提供数据支持、策略开发到策略输出的量化生态服务 京东金融官方资讯QQ群:417082141 有什么想咨询的都可以来询问我们哦 金融投机家保持100笔交易成功率达85%以上&#xff0c;得益于高胜算的趋势交易策略。综合技术应用顾比均线系统、…

【量化交易笔记】6.布林带的实现

上一讲介绍A股移动平均值&#xff08;MA&#xff09;指标&#xff0c;本讲我们来讲解布林布的实现。 布林线&#xff08;BOLL&#xff09;技术指标简介 布林线&#xff08;Bollinger Bands&#xff0c;BOLL&#xff09;又称布林带&#xff0c;是约翰布林&#xff08;John Bol…

Python股票量化学习(3)——简单的策略回测

搞一个简单的交易策略回测&#xff08;难点的我也不会啊&#xff09;。此策略基于布林通道&#xff0c;当股价低于布林通道下轨线且持仓为0时&#xff0c;以下轨线价格全仓买入&#xff08;不关心风险&#xff0c;反正也不要本钱&#xff09;。当股价突破布林线上轨且有持仓时&…

量化交易——布林带策略

一、布林带策略介绍 布林带/布林线/保利加通道(Bollinger Band)&#xff1a;由三条轨道线组成&#xff0c;其中上下两条线分别可以看成是价格的压力线和支撑线&#xff0c;在两条线之间是一条价格平均线。 一般来说&#xff0c;股价会运行在压力线和支撑线所形成的通道中。 与M…

【vn.py】源码解析之布林通道(BollChannel)策略

文章目录 Boll&#xff08;布林线&#xff09;指标CCI&#xff08;Commodity Channel Index&#xff09;指标布林通道策略布林通道策略源码分析1、完整源码2、策略参数与变量3、策略执行逻辑 Boll&#xff08;布林线&#xff09;指标 布林线是一种金融衍生品价格走势图中常用的…

量化交易——传统技术分析布林通道BollingerBands的原理及实现

布林通道 布林通道线是根据统计学的标准差来计算的&#xff0c;其具体可由上中下三条曲线展示。其中上下两线分别代表上升压力线和下降支撑线&#xff0c;故而可以根据K线图是否突破布林曲线来判断较好的买卖节点。三条曲线计算方法如下&#xff1a; 中轨线(MID)收盘价的M日移…

Lyndon的量化修炼之路——布林通道优化策略(二)

策略参数优化 //期市妖风大&#xff0c;小心被刮飞。本文不构成任何实质性建议&#xff0c;也不对任何依此进行的交易结果负责参数优化几乎是优化每一个量化交易策略的必经之路&#xff0c;对于参数优化的基本方法已经在双均线优化策略中介绍过&#xff0c;再次不多做介绍&…