Input : price(c),length(26),length2(2);
Var : MID(0),TMP(0),TOP(0),BOTTOM(0),MID2(0),TMP2(0),TOP2(0),BOTTOM2(0),MID3(0),TMP3(0),TOP3(0),BOTTOM3(0);
MID = average(C,length);
TMP = stddev(C,length);
TOP = MID + length2*TMP;
BOTTOM = MID - length2*TMP;
MID2 = average(C of data2,length);
TMP2 = stddev(C of data2,length);
TOP2 = MID + length2*TMP2;
BOTTOM2 = MID - length2*TMP2;
MID3 = average(C of data3,length);
TMP3 = stddev(C of data3,length);
TOP3 = MID + length2*TMP3;
BOTTOM3 = MID - length2*TMP3;
Plot1(TOP,"BOLL_top");
Plot2(MID,"BOLL_mid");
plot3(BOTTOM,"BOLL_bottom");
Condition1 = high[1]<top and high[0]>=top and high[0] > mid;
Condition2 = high[1]<top2 and high[0]>=top2 and high[0] > mid2;
Condition3 = high[1]<top3 and high[0]>=top3 and high[0] > mid3;
If condition1 AND condition2 and condition3 then
Begin
//为这些K线着色
SetPlotColor(1, Cyan);
End;
Var : MID(0),TMP(0),TOP(0),BOTTOM(0),MID2(0),TMP2(0),TOP2(0),BOTTOM2(0),MID3(0),TMP3(0),TOP3(0),BOTTOM3(0);
MID = average(C,length);
TMP = stddev(C,length);
TOP = MID + length2*TMP;
BOTTOM = MID - length2*TMP;
MID2 = average(C of data2,length);
TMP2 = stddev(C of data2,length);
TOP2 = MID + length2*TMP2;
BOTTOM2 = MID - length2*TMP2;
MID3 = average(C of data3,length);
TMP3 = stddev(C of data3,length);
TOP3 = MID + length2*TMP3;
BOTTOM3 = MID - length2*TMP3;
Plot1(TOP,"BOLL_top");
Plot2(MID,"BOLL_mid");
plot3(BOTTOM,"BOLL_bottom");
Condition1 = high[1]<top and high[0]>=top and high[0] > mid;
Condition2 = high[1]<top2 and high[0]>=top2 and high[0] > mid2;
Condition3 = high[1]<top3 and high[0]>=top3 and high[0] > mid3;
If condition1 AND condition2 and condition3 then
Begin
//为这些K线着色
SetPlotColor(1, Cyan);
End;