extern int ShiftHorizontal = 0; // 水平偏移量(往右移动多少根K线)
extern string NotePeriods = "==============HL Period Settings=============="; // 分段说明文字:高低点周期设置extern int PeriodForHL = 100; // 查找高低点时使用的区间长度extern int PeriodShiftBegin = 0; // 查找高低点的起始偏移,0表示从当前往回extern bool Use2Periods = False; // 是否分别使用两个周期查找最高/最低extern int PeriodForHigh = 100; // 用于查找最高点的周期(当Use2Periods=True)extern int PeriodForLow = 100; // 用于查找最低点的周期(当Use2Periods=True)
extern string NoteZigZag = "==============Zig Zag Settings=============="; // 分段说明文字:ZigZag参数设置extern int ZZDepth = 25; // ZigZag的Depth参数extern int ZZDeviation = 5; // ZigZag的Deviation参数extern int ZZBackstep = 3; // ZigZag的Backstep参数
extern string NoteFibo1 = "==============Fibonacci Settings=============="; // 分段说明文字:斐波那契参数1extern string NoteFibo2 = "By default, the direction of the move set the levels"; // 提示:默认按高低点方向设置斐波延伸extern string NoteFibo3 = "Set below to true to switch direction of fibs"; // 提示:可通过下方参数强制切换斐波方向extern bool SwitchFibo = False; // 是否切换斐波方向(True=反向绘制)
extern int LineLength = 4; // 斐波那契线段的长度(单位:K线数)extern bool RayLeftOn = True; // 是否向左侧延伸斐波那契线extern int RayLeftShift = 3; // 当左侧延伸时,从当前K线向左偏移多少
extern int ColorMode = 1; // 颜色模式:0=仅上下两色,1=多周期九色extern string ColorModeNote = "0=Two colors for up or down; 1=Nine different colors"; // 提示文字:颜色模式选择extern color ColorUp = Lime; // 当ColorMode=0时,上升用的颜色extern color ColorDn = Red; // 当ColorMode=0时,下降用的颜色extern color ColorM1 = White; // 当ColorMode=1时,M1周期线颜色extern color ColorM5 = Yellow; // 当ColorMode=1时,M5周期线颜色extern color ColorM15 = Blue; // 当ColorMode=1时,M15周期线颜色extern color ColorM30 = Pink; // 当ColorMode=1时,M30周期线颜色extern color ColorH1 = Magenta; // 当ColorMode=1时,H1周期线颜色extern color ColorH4 = Lime; // 当ColorMode=1时,H4周期线颜色extern color ColorD1 = Red; // 当ColorMode=1时,D1周期线颜色extern color ColorW1 = Green; // 当ColorMode=1时,W1周期线颜色extern color ColorMN1 = DeepSkyBlue; // 当ColorMode=1时,MN1周期线颜色
extern bool AutomaticallySetLineWidth = True; // 是否自动设置线宽(随周期加粗)extern int LineWidthM1 = 1; // M1线宽(当自动设置=假时生效)extern int LineWidthM5 = 1; // M5线宽(当自动设置=假时生效)extern int LineWidthM15 = 1; // M15线宽(当自动设置=假时生效)extern int LineWidthM30 = 1; // M30线宽(当自动设置=假时生效)extern int LineWidthH1 = 1; // H1线宽(当自动设置=假时生效)extern int LineWidthH4 = 1; // H4线宽(当自动设置=假时生效)extern int LineWidthD1 = 1; // D1线宽(当自动设置=假时生效)extern int LineWidthW1 = 1; // W1线宽(当自动设置=假时生效)extern int LineWidthMN1 = 1; // MN1线宽(当自动设置=假时生效)
int TFCountTotal,TFCountM1,TFCountM5,TFCountM15,TFCountM30,TFCountH1,TFCountH4,TFCountD1,TFCountW1,TFCountMN1;// 统计不同周期是否启用的计数,用于逻辑判定string StringM1,StringM5,StringM15,StringM30,StringH1,StringH4,StringD1,StringW1,StringMN1;// 不同周期对应的字符串表述(如"M15"等)
int TFShift1,TFShift2,TFShift3,TFShift4,TFShift5,TFShift6,TFShift7,TFShift8,TFShift9;// 不同周期横向移动量(如斐波那契线向右偏移量)的中间变量int TFShiftM1,TFShiftM5,TFShiftM15,TFShiftM30,TFShiftH1,TFShiftH4,TFShiftD1,TFShiftW1,TFShiftMN1;// 具体存放每个周期线的最终横向偏移
int LineWidth1,LineWidth2,LineWidth3,LineWidth4,LineWidth5,LineWidth6,LineWidth7,LineWidth8,LineWidth9;// 不同周期线宽叠加计算的中间变量int WidthM1,WidthM5,WidthM15,WidthM30,WidthH1,WidthH4,WidthD1,WidthW1,WidthMN1;// 每个周期实际使用的线条宽度
int ChartScaleDescription; // 用于存放图表缩放级别(可能用于自动定位文本等)
ArraySetAsSeries(ZZBuffer,True); ArraySetAsSeries(M1_ZZBuffer,True); ArraySetAsSeries(M5_ZZBuffer,True); ArraySetAsSeries(M15_ZZBuffer,True); ArraySetAsSeries(M30_ZZBuffer,True); ArraySetAsSeries(H1_ZZBuffer,True); ArraySetAsSeries(H4_ZZBuffer,True); ArraySetAsSeries(D1_ZZBuffer,True); ArraySetAsSeries(W1_ZZBuffer,True); ArraySetAsSeries(MN1_ZZBuffer,True);//+------------------------------------------------------------------+ IndicatorShortName("Fibo Color Zones All TF");
if(PeriodForHL<1 || PeriodForHigh<1 || PeriodForLow<1) { PeriodForHL = 100; PeriodForHigh=100; PeriodForLow=100; Alert("Fibo Color Zones : Warning ! 'Period' should not be less than 1"); }//+------------------------------------------------------------------+ TimeFrames = StringTrimLeft(StringTrimRight(TimeFrames)); if(StringSubstr(TimeFrames,StringLen(TimeFrames),1) != ";") TimeFrames = StringConcatenate(TimeFrames,";");
int s = 0; i = StringFind(TimeFrames,";",s); int time; string current; while(i > 0) { current = StringSubstr(TimeFrames,s,i-s); time = stringToTimeFrame(current); if(time > 0) { ArrayResize(labels,ArraySize(labels) +1); labels [ArraySize(labels) -1] = TimeFrameToString(time); } s = i + 1; i = StringFind(TimeFrames,";",s); }//+------------------------------------------------------------------+ if(AutomaticallySetDescriptions) { if(ChartGetInteger(0,CHART_SCALE) == 0) ChartScaleDescription = 900; if(ChartGetInteger(0,CHART_SCALE) == 1) ChartScaleDescription = 400; if(ChartGetInteger(0,CHART_SCALE) == 2) ChartScaleDescription = 200; if(ChartGetInteger(0,CHART_SCALE) == 3) ChartScaleDescription = 100; if(ChartGetInteger(0,CHART_SCALE) == 4) ChartScaleDescription = 50; if(ChartGetInteger(0,CHART_SCALE) == 5) ChartScaleDescription = 25; } else ChartScaleDescription = ShiftDescriptionUpDn;//+------------------------------------------------------------------+ return(INIT_SUCCEEDED); }