- #property indicator_chart_window
- extern int STD_Rgres_period=0;
- extern int STD_Rgres_length=56; // bars back regression begins
- extern double STD_Rgres_width=1.618;// widest channel
- extern double STD_width=0.618; // inside channel
- int init()
- {
- return(0);
- }
- int deinit()
- {
- ObjectDelete("regression channel");ObjectDelete("std channel");return(0);
- }
- int start()
- {
- ObjectDelete("regression channel");ObjectDelete("std channel");
- ObjectCreate("regression channel",OBJ_STDDEVCHANNEL,0,iTime(Symbol(),STD_Rgres_period,STD_Rgres_length), Close[STD_Rgres_length],Time[0],Close[0]);
- ObjectSet("regression channel",OBJPROP_DEVIATION,STD_Rgres_width);
- ObjectSet("regression channel",OBJPROP_COLOR,Orange);
- ObjectSet("regression channel",OBJPROP_RAY,true);
- ObjectCreate("std channel",OBJ_STDDEVCHANNEL,0,iTime(Symbol(),STD_Rgres_period,STD_Rgres_length), Close[STD_Rgres_length],Time[0],Close[0]);
- ObjectSet("std channel",OBJPROP_DEVIATION,STD_width);
- ObjectSet("std channel",OBJPROP_COLOR,Olive);
- ObjectSet("std channel",OBJPROP_RAY,true);
- return(0);
- }
复制代码
|