- 帖子
- 117850
- 精华
- 51
- 积分
- 42319
- 智慧
- 20273
- V 币
- 98161
- 贡献
- 0
- 金豆
- 59709
- MV号码
- 2716677
- 注册时间
- 2008-8-7
- 最后登录
- 2011-7-30
|
楼主
发表于 2011-6-30 16:52
| 只看该作者
编写指标公式技巧全集 | | | 0055--底背离
LLV(L,60)=L) AND NOT(LLV(DEA,60)=DEA);
0056--顶背离
HHV(H,60)=H) AND NOT(HHV(DEA,60)=DEA);
0057--N次金叉、死叉
0轴上二次金叉
COUNT(CROSS(DIF,DEA) AND DEA>0,20)=2 AND CROSS(DIF,DEA) AND
DEA>0;
0轴上三次金叉
COUNT(CROSS(DIF,DEA) AND DEA>0,20)=3 AND CROSS(DIF,DEA) AND
DEA>0;
0轴上四次金叉
COUNT(CROSS(DIF,DEA) AND DEA>0,20)=4 AND CROSS(DIF,DEA) AND DEA>0;
二次金叉
EXPLAIN(COUNT(CROSS(DIF,DEA),20)=2 AND CROSS(DIF,DEA);
二次死叉
COUNT(CROSS(DEA,DIF),20)=2 AND CROSS(DEA,DIF);
0058--5分钟副图显示15分钟K线
建公式:0015
C15:CLOSE;
O15:OPEN;
H15:HIGH;
L15OW;
建公式:十五K线
C15:="0015.C15#MIN15";
O15:="0015.O15#MIN15";
H15:="0015.H15#MIN15";
L15:="0015.L15#MIN15";
TI:=OPENMINUTES(TIME)=10 OR OPENMINUTES(TIME)=25 OR OPENMINUTES(TIME)=40 OR OPENMINUTES(TIME)=55 OR OPENMINUTES(TIME)=70 OR OPENMINUTES(TIME)=85 OR OPENMINUTES(TIME)=100 OR OPENMINUTES(TIME)=115 OR OPENMINUTES(TIME)=130 OR OPENMINUTES(TIME)=145 OR OPENMINUTES(TIME)=160 OR OPENMINUTES(TIME)=175 OR OPENMINUTES(TIME)=190 OR OPENMINUTES(TIME)=205 OR OPENMINUTES(TIME)=220 OR OPENMINUTES(TIME)=235;
HH15:=IF(TI,H15,C15);
LL15:=IF(TI,L15,C15);
STICKLINE(C15>O15,C15,O15,10,0),COLORRED;
STICKLINE(C15>O15 AND H15>C15,HH15,C15,0.1,0),COLORRED;
STICKLINE(C15>O15 AND O15>L15,O15,LL15,0.1,0),COLORRED;
STICKLINE(C15<=O15,C15,O15,10,0),COLORGREEN;
STICKLINE(C15<=O15 AND C15>L15,C15,LL15,0.1,0),COLORGREEN;
STICKLINE(C15<=O15 AND H15>O15,HH15,O15,0.1,0),COLORGREEN;
注:以大陆股市为例,四小时,其他市场如超过四小时,可在中间语句“TI:=”中以15为系数顺序加足,如:OR 250 OR 265……等等。
0059--移动成本
不知道函数算法,计算误差在所难免。调整参数“%”可看到不同的移动成本。
///筹码%
INPUT:%(90,1,100);
A:=AMOUNT/V/100;
成本:FLOOR(COST(50-%/2)*100)/100,COLORYELLOW,LINETHICK0;
~:CEILING(COST(50+%/2)*100)/100,COLORYELLOW,LINETHICK0;
集中度:INTPART((~-成本)/(~+成本)*1000)/10,COLORGREEN;
平均成本:ROUND(COST(50)*100)/100,LINETHICK0;
穿透力WINNER(C)-REF(WINNER(C),1))/V*CAPITAL,LINETHICK0;//计算误差大
//穿透力2WINNER(C)-WINNER(O))/V*CAPITAL,LINETHICK0;//这一写法还是误差大
获利比例:ROUND(WINNER(C)*1000)/10,LINETHICK0; |
|
|
|