以下是同花顺小牛趋势线副图源码
详见图示。
买卖点说明:
买点:文字标注“始”。
卖点:文字标注“终”。
1、当有连续多个“始”,以第一个“始”做为买点,忽略后面的信号。
2、当有连续多个“终”,以第一个“终”做为卖点,忽略后面的信号。
3、最优指标成功率、收益率的统计也是以第一个“始”与第一个“终”做为统计点。
N:=120;
方向线:4*SMA((CLOSE-LLV(LOW,n))/(HHV(HIGH,n)-LLV(LOW,n))*100,5,1)-
3*SMA(SMA((CLOSE-LLV(LOW,n))/(HHV(HIGH,n)-LLV(LOW,n))*100,5,1),3.2,1), Culor00FFFF ,linethick2;
N:=10;
趋势:4*SMA((CLOSE-LLV(LOW,n))/(HHV(HIGH,n)-LLV(LOW,n))*100,5,1)-
3*SMA(SMA((CLOSE-LLV(LOW,n))/(HHV(HIGH,n)-LLV(LOW,n))*100,5,1),3.2,1),Culor0000FF,linethick2;
阳线:IF(趋势<=8,5,0),CulorCD7F32 ,linethick3;
副线2:IF(趋势<=18,15,10),CulorC0C0C0, linethick1 ;
副线3:IF(趋势<=28,25,20),Culor93DB70,linethick2;
副线4:IF(趋势<=38,35,30),CulorC0C0C0, linethick1 ;
副线5:IF(趋势<=48,45,40),Culor0000FF,LINETHICK3;
副线6:IF(趋势<=58,55,50),CulorC0C0C0, linethick1 ;
副线7:IF(趋势<=68,65,60),Culor93DB70,linethick2;
副线8:IF(趋势<=78,75,70),CulorC0C0C0, linethick1 ;
副线9:IF(趋势<=88,85,80),Culor93DB70,linethick2;
副线10:IF(趋势<=98,95,90),CulorC0C0C0, linethick1 ;
副线11:IF(趋势<=108,105,100),Culor00FF00,linethick2;
顶:IF(趋势<=118,115,110),Culor0000FF,linethick1;
负线:IF(趋势>=-8,-6,-5),Culor0000FF,linethick1;
底:IF(趋势>=-18,-15,-10),Culor00FF00,linethick3;
线8:IF(方向线<=8,-12,-15),Culor0000FF ,linethick1;
线20:IF(方向线<=28,-10,-15),Culor00FFFF,linethick1;
线40:IF(方向线<=48,-8,-15),Culor00FF00,linethick1;
线60:IF(方向线<=68,115,108),,CulorCD7F32 ,linethick1;
线80:IF(方向线<=88,115,110),CulorFFFFFF,linethick1;
线100:IF(方向线<=108,115,112),Culor0000FF ,linethick1;
DRAWTEXT(CROSS(趋势,方向线),趋势,\’始\’);
DRAWTEXT(CROSS(副线7,趋势),趋势,\’终\’);