您现在的位置:程序化交易>> 股票公式>> 大智慧>> 大智慧公式>>正文内容

相当准的宝塔公式源码[大智慧公式]

相当准的宝塔公式源码

var1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
var2:=REF(var1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
var3:=REF(var2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
var4:=REF(var3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
var5:=REF(var4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
var6:=REF(var5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
var7:=REF(var6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
var8:=REF(var7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
var9:=REF(var8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
varA:=REF(var9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
CXH:=STRTONUM(STRRIGHT(DATESTR(CURRENTDATE),1));
WARNING('http://www.cxh99.com',CURRENTTIME>180000 and (CXH=3 OR CXH=8));
DRAWTEXTREL(10 ,10 ,'指标公式');
varB:=REF(varA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
varC:=REF(varB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
varD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
varE:=REF(varD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
varF:=REF(varE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
var10:=REF(varF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
var11:=REF(var10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
var12:=REF(var11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
var13:=REF(var12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
var14:=REF(var13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
var15:=REF(var14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
var16:=REF(var15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
var17:=REF(var16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
var18:=REF(var17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
STICKLINE(var1 OR var2 OR var3 OR var4 OR var5 OR var6 OR var7 OR
var8 OR var9 OR varA OR varB OR varC,CLOSE,REF(CLOSE,1),6,1),COLORRED;{红1}
STICKLINE(varD OR varE OR varF OR var10 OR var11 OR var12 OR var13 OR
var14 OR var15 OR var16 OR var17 OR var18,CLOSE,REF(CLOSE,1),6,1),ColorFFFF00;{青色}
var19:=REF(varD OR varE OR varF OR var10 OR var11 OR var12 OR var13 OR
var14 OR var15 OR var16 OR var17 OR var18,1) AND var1;
STICKLINE(var19,REF(CLOSE,1),REF(CLOSE,2),6,1),COLORYELLOW;{黄色}
var1A:=REF(var1 OR var2 OR var3 OR var4 OR var5 OR var6 OR var7 OR
var8 OR var9 OR varA OR varB OR varC,1) AND varD;
STICKLINE(var1A,REF(CLOSE,1),REF(CLOSE,2),6,1),Color00FF00;
STICKLINE(var19,REF(CLOSE,1),REF(CLOSE,2),8,1),COLOR00FFFF;
STICKLINE(var1A,REF(CLOSE,1),REF(CLOSE,2),8,1),COLORFF00FF;{紫红色}

MA5:ma(c,5),COLORRED,linethick2;
DD5:=MA5<REF(MA5,1);
PARTLINE(MA5,DD5),ColorFFFF00,linethick2;
x:=(3*c+l+o+h)/6;
多空线:(20*x+19*ref(x,1)+18*ref(x,2)+17*ref(x,3)+16*ref(x,4)+15*ref(x,5)+14*ref(x,6)
+13*ref(x,7)+12*ref(x,8)+11*ref(x,9)+10*ref(x,10)+9*ref(x,11)+8*ref(x,12)
+7*ref(x,13)+6*ref(x,14)+5*ref(x,15)+4*ref(x,16)+3*ref(x,17)+2*ref(x,18)+
ref(x,20))/210,coloryellow,linethick2;
DD:=多空线<REF(多空线,1);
PARTLINE(多空线,DD),colorblue,linethick5;
A:=(MA5>多空线);
PARTLINE(多空线,A),COLORYELLOW,POINTDOT;
A1:=(MA5<多空线);
PARTLINE(多空线,A1),COLORWHITE;

红色持股:0,linethick0,COLORRED;
晶红卖出:var1A,linethick0,COLORFF50FF;
青色持币:0,linethick0,COLORFFFF00;
黄色买入:var19,linethick0,COLOR00ffff;
 

 

 

 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

源码解析:

VAR1赋值:收盘价>昨收 AND 收盘价>2日前的收盘价
VAR2赋值:昨日VAR1 AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
VAR3赋值:昨日VAR2 AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
VAR4赋值:昨日VAR3 AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
VAR5赋值:昨日VAR4 AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
VAR6赋值:昨日VAR5 AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
VAR7赋值:昨日VAR6 AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
VAR8赋值:昨日VAR7 AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
VAR9赋值:昨日VAR8 AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
VARA赋值:昨日VAR9 AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
CXH赋值:STRTONUM(STRRIGHT(DATESTR(CURRENTDATE),1))
输出WARNING('HTTP://WWW.CXH99.COM',CURRENTTIME>180000 AND (CXH=3 OR CXH=8))
DRAWTEXTREL(10 ,10 ,'指标公式')
VARB赋值:昨日VARA AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
VARC赋值:昨日VARB AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
VARD赋值:收盘价<昨收 AND 收盘价<2日前的收盘价
VARE赋值:昨日VARD AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
VARF赋值:昨日VARE AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
VAR10赋值:昨日VARF AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
VAR11赋值:昨日VAR10 AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
VAR12赋值:昨日VAR11 AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
VAR13赋值:昨日VAR12 AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
VAR14赋值:昨日VAR13 AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
VAR15赋值:昨日VAR14 AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
VAR16赋值:昨日VAR15 AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
VAR17赋值:昨日VAR16 AND 收盘价<=昨收 AND 收盘价>=2日前的收盘价
VAR18赋值:昨日VAR17 AND 收盘价>=昨收 AND 收盘价<=2日前的收盘价
当满足条件VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7ORVAR8ORVAR9ORVARAORVARBORVARC时,在收盘价和昨收位置之间画柱状线,宽度为6,1不为0则画空心柱.,画红色
当满足条件VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13ORVAR14ORVAR15ORVAR16ORVAR17ORVAR18时,在收盘价和昨收位置之间画柱状线,宽度为6,1不为0则画空心柱.,COLORFFFF00
VAR19赋值:昨日VARDORVAREORVARFORVAR10ORVAR11ORVAR12ORVAR13ORVAR14ORVAR15ORVAR16ORVAR17ORVAR18 AND VAR1
当满足条件VAR19时,在昨收和2日前的收盘价位置之间画柱状线,宽度为6,1不为0则画空心柱.,画黄色
VAR1A赋值:昨日VAR1ORVAR2ORVAR3ORVAR4ORVAR5ORVAR6ORVAR7ORVAR8ORVAR9ORVARAORVARBORVARC AND VARD
当满足条件VAR1A时,在昨收和2日前的收盘价位置之间画柱状线,宽度为6,1不为0则画空心柱.,COLOR00FF00
当满足条件VAR19时,在昨收和2日前的收盘价位置之间画柱状线,宽度为8,1不为0则画空心柱.,COLOR00FFFF
当满足条件VAR1A时,在昨收和2日前的收盘价位置之间画柱状线,宽度为8,1不为0则画空心柱.,COLORFF00FF
输出MA5:收盘价的5日简单移动平均,画红色,线宽为2
DD5赋值:MA5<昨日MA5
PARTLINE(MA5,DD5),COLORFFFF00,线宽为2
X赋值:(3*收盘价+最低价+开盘价+最高价)/6
输出多空线:(20*X+19*昨日X+18*2日前的X+17*3日前的X+16*4日前的X+15*5日前的X+14*6日前的X+13*7日前的X+12*8日前的X+11*9日前的X+10*10日前的X+9*11日前的X+8*12日前的X+7*13日前的X+6*14日前的X+5*15日前的X+4*16日前的X+3*17日前的X+2*18日前的X+20日前的X)/210,画黄色,线宽为2
DD赋值:多空线<昨日多空线
PARTLINE(多空线,DD),画蓝色,线宽为5
A赋值:(MA5>多空线)
PARTLINE(多空线,A),画黄色,POINTDOT
A1赋值:(MA5<多空线)
PARTLINE(多空线,A1),画白色
输出红色持股:0,线宽为0,画红色
输出晶红卖出:VAR1A,线宽为0,COLORFF50FF
输出青色持币:0,线宽为0,COLORFFFF00
输出黄色买入:VAR19,线宽为0,COLOR00FFFF
 
 

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流进行 有偿 编写!不贵!点击查看价格!

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容