请提供具体的策略思路,我们尝试根据您的思路进行编写。
input:Length(20);variable:MA(0),H_Length(0),L_Length(0),High_Low(0),Half_H_L(0),K(0),one_twoK(0),H_2K(0),twoK_one(0),L_2K(0),Up_Band(0),down_Band(0);MA = average(close,Length);H_Length = highest(high,Length);L_Length = lowest(low,Length);High_Low = high - low;Half_H_L = (high + low) / 2;K = High_Low / Half_H_L;one_twoK = 1+2*K;H_2K = high * one_twoK;twoK_one = 1-2*K;L_2K = low * twoK_one;Up_Band = average(H_2K,Length);down_Band = average(L_2K,Length);plot2(MA ,"MA");if currentbar >= Length + Length then beginplot1(Up_Band,"Up_Band");plot3(down_Band,"down_Band");end;