大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频75-大伊香蕉在线精品视频人碰人
打印本文
關閉窗口
麥語言的編程思維實在轉不過來,請老師幫我改下
作者:文華財經 來源:cxh99.com 發布時間:2016年01月05日
咨詢內容:
for (i = Bars; i >= 0; i--) { TrendUp[i] = EMPTY_VALUE; TrendDown[i] = EMPTY_VALUE; atr = iATR(NULL, 0, Nbr_Periods, i); medianPrice = (High[i]+Low[i])/2; up[i]=medianPrice+(Multiplier*atr); dn[i]=medianPrice-(Multiplier*atr); trend[i]=1; if (Close[i]>up[i+1]) { trend[i]=1; if (trend[i+1] == -1) changeOfTrend = 1; } else if (Close[i]<dn[i+1]) { trend[i]=-1; if (trend[i+1] == 1) changeOfTrend = 1; } else if (trend[i+1]==1) { trend[i]=1; changeOfTrend = 0; } else if (trend[i+1]==-1) { trend[i]=-1; changeOfTrend = 0; }
if (trend[i]<0 && trend[i+1]>0) { flag=1; } else { flag=0; } if (trend[i]>0 && trend[i+1]<0) { flagh=1; } else { flagh=0; } if (trend[i]>0 && dn[i]<dn[i+1]) dn[i]=dn[i+1]; if (trend[i]<0 && up[i]>up[i+1]) up[i]=up[i+1]; if (flag==1) up[i]=medianPrice+(Multiplier*atr); if (flagh==1) dn[i]=medianPrice-(Multiplier*atr); //-- Draw the indicator if (trend[i]==1) { TrendUp[i]=dn[i]; if (changeOfTrend == 1) { TrendUp[i+1] = TrendDown[i+1]; changeOfTrend = 0; } } else if (trend[i]==-1) { TrendDown[i]=up[i]; if (changeOfTrend == 1) { TrendDown[i+1] = TrendUp[i+1]; changeOfTrend = 0; } } }然后在主圖上畫出TrendDown, TrendUp兩條線
文華技術人員:
查看了一下您的源碼,代碼是不完整的,缺少變量Multiplier定義部分。
您的公式是MT4指標吧。請提供下完整源碼,以便我們為您修改。
文華客服:
這個不影響就一個變量
double TrendUp[], TrendDown[];int changeOfTrend;extern int Nbr_Periods = 10;extern double Multiplier = 2;int init() {//---- indicators SetIndexBuffer(0, TrendUp); SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 3); SetIndexLabel(0, "Trend Up"); SetIndexBuffer(1, TrendDown); SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 3); SetIndexLabel(1, "Trend Down");//---- return(0); }
int start() { int limit, i, flag, flagh, trend[5000]; double up[5000], dn[5000], medianPrice, atr; int counted_bars = IndicatorCounted();//---- check for possible errors if(counted_bars < 0) return(-1);//---- last counted bar will be recounted if(counted_bars > 0) counted_bars--; limit=Bars-counted_bars;
for (i = Bars; i >= 0; i--) { TrendUp[i] = EMPTY_VALUE; TrendDown[i] = EMPTY_VALUE; atr = iATR(NULL, 0, Nbr_Periods, i); medianPrice = (High[i]+Low[i])/2; up[i]=medianPrice+(Multiplier*atr); dn[i]=medianPrice-(Multiplier*atr); trend[i]=1;
if (Close[i]>up[i+1])
{
trend[i]=1;
if (trend[i+1] == -1) changeOfTrend = 1;
}
else if (Close[i]<dn[i+1]) {
trend[i]=-1;
if (trend[i+1] == 1) changeOfTrend = 1;
}
else if (trend[i+1]==1) {
trend[i]=1;
changeOfTrend = 0;
}
else if (trend[i+1]==-1) {
trend[i]=-1;
changeOfTrend = 0;
}
if (trend[i]<0 && trend[i+1]>0) {
flag=1;
}
else {
flag=0;
}
if (trend[i]>0 && trend[i+1]<0) {
flagh=1;
}
else {
flagh=0;
}
if (trend[i]>0 && dn[i]<dn[i+1])
dn[i]=dn[i+1];
if (trend[i]<0 && up[i]>up[i+1])
up[i]=up[i+1];
if (flag==1)
up[i]=medianPrice+(Multiplier*atr);
if (flagh==1)
dn[i]=medianPrice-(Multiplier*atr);
//-- Draw the indicator
if (trend[i]==1) {
TrendUp[i]=dn[i];
if (changeOfTrend == 1) {
TrendUp[i+1] = TrendDown[i+1];
changeOfTrend = 0;
}
}
else if (trend[i]==-1) {
TrendDown[i]=up[i];
if (changeOfTrend == 1) {
TrendDown[i+1] = TrendUp[i+1];
changeOfTrend = 0;
}
}
}
然后在主圖上畫出
TrendDown, TrendUp兩條線
網友回復:
我們研究一下,MT4改寫需要一些時間。改寫好后會第一時間為您回復。
網友回復:
老師,您好,我的程序改好沒有?
打印本文
關閉窗口
主站蜘蛛池模板:
欧美日韩国产一区二区
|
亚洲专区区免费
|
久久色精品
|
久久久国产精品免费视频
|
国产精品人成人免费国产
|
jizzjizz护士xxx
|
激情在线视频
|
成人夜夜
|
成人国产亚洲
|
九九99九九精彩
|
四虎影视大全
|
天天摸夜夜
|
国产日产精品
|
精品一区二区三区在线视频观看
|
韩日视频在线观看
|
手机看片福利
|
亚洲成aⅴ人片在线观
|
快色视频网站
|
免费看一级毛片
|
99精品观看
|
免费精品美女久久久久久久久久
|
一级片在线观看免费
|
亚洲激情一区
|
国内一级特黄女人精品片
|
欧美三级成人理伦
|
videos欧美黑白爆交
|
中文字幕亚洲欧美
|
九九在线免费视频
|
久久亚洲精品永久网站
|
亚洲国产精品专区
|
亚洲天天做夜夜做天天欢
|
成人免费一区二区三区在线观看
|
亚洲综合一区二区三区四区
|
国产精品香蕉在线一区
|
成人美女隐私免费
|
中文字幕亚洲高清综合
|
999精品在线视频
|
国产一区二区三区乱码网站
|
91福利国产在线观看
|
国内精品久久久久久不卡影院
|
国产精品美女一级在线观看
|