一直在用的一个指标 源码 分享给大家 供大家优化自用
指标中 有两个函数CAPITAL 和cost
{指标中 有两个函数CAPITAL 和COST}
VAR0:=IF(DATE <= 1160930,1,0);
VAR1:=SMA(MAX(MAX(HIGH - LOW,ABS(HIGH - REF(CLOSE,1))),ABS(LOW - REF(CLOSE,1))),14,1);
VAR2:=HIGH - REF(HIGH,1);
VAR3:=REF(LOW,1) - LOW;
VAR4:=SMA(IF(VAR2 > 0 AND VAR2 > VAR3,VAR2,0),12,1);
VAR5:=SMA(IF(VAR3 > 0 AND VAR3 > VAR2,VAR3,0),12,1);
VAR6:=VAR4 * 100 / VAR1;
VAR7:=VAR5 * 100 / VAR1;
VAR8:=SMA(ABS(VAR7 - VAR6) / (VAR7 + VAR6) * 100,12,1);
VAR9:=(VAR8 + REF(VAR8,5)) / 2;
VAR10:=SUM(HIGH - OPEN,12) / SUM(OPEN - LOW,12) * 100;
VAR11:=SUM(MAX(0,HIGH - REF(CLOSE,1)),12) / SUM(MAX(0,REF(CLOSE,1) - LOW),12) * 100;
VAR12:=AMOUNT / VOL / 100;
VAR13:=(3 * HIGH + LOW + OPEN + 2 * CLOSE) / 7;
VAR14:=SUM(AMOUNT,5) / VAR12 / 100;
VAR15:=SUM(AMOUNT,13) / VAR12 / 100;
VAR16:=SUM(AMOUNT,34) / VAR12 / 100;
VAR17:=SUM(AMOUNT,209) / VAR12 / 100;
VAR18:=REF(VOL,1) + REF(VOL,2) + REF(VOL,3) + REF(VOL,4);
VAR19:=VAR18 / CAPITAL;
VAR20:=VOL / CAPITAL * VAR13 + VAR19 * REF(VAR12,1);
VAR21:=DMA(VAR13,VOL / VAR14);
VAR22:=DMA(VAR13,VOL / VAR15);
VAR23:=DMA(VAR13,VOL / VAR16);
VAR24:=DMA(VAR13,VOL / CAPITAL);
VAR25:=MA(HHV(HIGH,488),18);
VAR26:=MA(HHV(HIGH,220),18);
VAR27:=MA(HHV(HIGH,98),18);
VAR28:=MA(LLV(LOW,488),18);
VAR29:=MA(LLV(LOW,220),18);
VAR30:=MA(LLV(LOW,98),18);
VAR31:=MA((VAR28 * 0.96 + VAR29 * 0.96 + VAR30 * 0.96 + VAR25 * 0.558 + VAR26 * 0.558 + VAR27 * 0.558) / 6,18);
VAR32:=MA((VAR28 * 1.25 + VAR29 * 1.23 + VAR30 * 1.2 + VAR25 * 0.55 + VAR26 * 0.55 + VAR27 * 0.65) / 6,18);
VAR33:=MA((VAR28 * 1.3 + VAR29 * 1.3 + VAR30 * 1.3 + VAR25 * 0.68 + VAR26 * 0.68 + VAR27 * 0.68) / 6,18);
VAR34:=MA((VAR31 * 3 + VAR32 * 2 + VAR33) / 6 * 1.738,18);
VAR35:=IF(DATE <= 1031231,VAR34,VAR34 * DAY);
VAR36:=LOW;
VAR37:=REF(LOW,1);
VAR38:=SMA(ABS(VAR36 - VAR37),3,1) / SMA(MAX(VAR36 - VAR37,0),3,1) * 100;
VAR39:=MA(IF(CLOSE * 1.35 <= VAR35,VAR38 * 10,VAR38 / 10),3);
VAR40:=LLV(LOW,30);
VAR41:=HHV(VAR39,30);
VAR42:=IF(LOW <= VAR40,(VAR39 + VAR41 * 2) / 2,0);
VAR43:=MA(HHV(HIGH,488),18);
VAR44:=MA(HHV(HIGH,220),18);
VAR45:=MA(HHV(HIGH,98),18);
VAR46:=MA(LLV(LOW,488),18);
VAR47:=MA(LLV(LOW,220),18);
VAR48:=MA(LLV(LOW,98),18);
VAR49:=MA((VAR46 * 0.96 + VAR47 * 0.96 + VAR48 * 0.96 + VAR43 * 0.558 + VAR44 * 0.558 + VAR45 * 0.558) / 6,18);
VAR50:=MA((VAR46 * 1.25 + VAR47 * 1.23 + VAR48 * 1.2 + VAR43 * 0.55 + VAR44 * 0.55 + VAR45 * 0.65) / 6,18);
VAR51:=MA((VAR46 * 1.3 + VAR47 * 1.3 + VAR48 * 1.3 + VAR43 * 0.68 + VAR44 * 0.68 + VAR45 * 0.68) / 6,18);
VAR52:=MA((VAR49 * 3 + VAR50 * 2 + VAR51) / 6 * 1.738,18);
VAR53:=VAR52;
VAR54:=LOW;
VAR55:=REF(LOW,1);
VAR56:=SMA(ABS(VAR54 - VAR55),3,1) / SMA(MAX(VAR54 - VAR55,0),3,1) * 100;
VAR57:=MA(IF(CLOSE * 1.35 <= VAR53,VAR56 * 10,VAR56 / 10),3);
VAR58:=LLV(LOW,30);
VAR59:=HHV(VAR57,30);
VAR60:=IF(LOW <= VAR58,(VAR57 + VAR59 * 2) / 2,0);
VAR61:=MA(VAR60 AND CLOSE < COST(1),3);
VAR62:=MA(VAR42 AND CLOSE < COST(1),3) AND (CLOSE - VAR22) / VAR22 * 100 < 2 - 13;
VAR63:=EMA(3 * SMA((CLOSE - LLV(LOW,27)) / (HHV(HIGH,27) - LLV(LOW,27)) * 100,5,1) - 2 * SMA(SMA((CLOSE - LLV(LOW,27)) / (HHV(HIGH,27) - LLV(LOW,27)) * 100,5,1),3,1),5) / 100;
VAR64:=IF((REF(CLOSE,13) - CLOSE) / REF(CLOSE,13) * 100 > 15 AND SUM(VOL / CAPITAL,13) * 100 < 18 AND VOL / CAPITAL * 100 < 2.5 AND (REF(CLOSE,1) - CLOSE) / REF(CLOSE,1) * 100 < 8,0.7,0);
VAR65:=(CLOSE - REF(CLOSE,1)) / REF(CLOSE,1) * 100;
VAR66:=MA(VOL,2) / MA(VOL,10);
VAR67:=VOL / CAPITAL;
VAR68:=0.0068 * VAR65 - 0.0072 * VAR66 - 0.5676 * VAR67 - 0.0105;
VAR69:=0.0015 * VAR65 - 0.0124 * VAR66 + 1.7461 * VAR67 - 0.0074;
VAR70:=0 - 0.0003 * VAR65 + 0.047 * VAR66 - 0.5734 * VAR67 - 0.0549;
VAR71:=0 - 12.2401 * VAR68 - 1 * VAR69 + 0.321 < 0;
VAR72:=(CLOSE - MA(CLOSE,27)) / MA(CLOSE,27) < 0 - 0.16;
VAR73:=STICKLINE(VAR72,0,0.5,2,0);
XG:VAR62 * VAR0 AND VAR71 * VAR0;