BBwithFractdev ------
// BBwithFractdev#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 Yellow
#property indicator_color3 Blue
extern int 周期 = 13;
extern double 偏差 = 2.618;
double 红上轨[];
double 黄中轨[];
double 蓝下轨[];
//--------------初始化---------------+
void init()
{
SetIndexStyle(0, DRAW_LINE);
SetIndexStyle(1, DRAW_LINE);
SetIndexStyle(2, DRAW_LINE);
IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS));
SetIndexBuffer(0, 红上轨);
SetIndexBuffer(1, 黄中轨);
SetIndexBuffer(2, 蓝下轨);
}
//---------------主函数----------------+
void start()
{
double 区间均值, sko, sum;
if(Bars<=周期)
return;
for(int i=Bars-周期; i>=0; i--) {
黄中轨= iMA(NULL,0,周期,0,MODE_SMA,PRICE_CLOSE,i);
sum= 0;
for(int j=0; j<周期; j++)
sum += Close;
区间均值= sum/周期;
sum= 0;
for(j=0; j<周期; j++)
sum += (Close-区间均值)*(Close-区间均值);
sko= MathSqrt(sum/周期);
Print("偏差=",偏差,"sko=",sko);
红上轨= 黄中轨+(偏差*sko);
蓝下轨= 黄中轨-(偏差*sko);
}
}
//+------------------------------------------------------------------+ 围观中~~~ nice!!!!!!!!!!!! EA真的能赚钱么? 看看怎么样
呵呵 谢谢分享,赞一个 我是来刷分的,嘿嘿 学习了,不错 帮你顶下哈!!
页:
[1]
2