人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看
打印本文
關閉窗口
麥語言的編程思維實在轉不過來,請老師幫我改下
作者:文華財經 來源: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改寫需要一些時間。改寫好后會第一時間為您回復。
網友回復:
老師,您好,我的程序改好沒有?
打印本文
關閉窗口
主站蜘蛛池模板:
在线片视频网站
|
色视频国产
|
美日韩精品
|
欧美激情免费a视频
|
成人合集大片bd高清在线观看
|
欧美妇性猛交视频
|
免费黄色大片视频
|
97免费在线
|
毛片毛片大全aaaa
|
欧美日韩无线码免费播放
|
久爱视频www在线播放
|
天堂网资源
|
国产黄在线播放免费观看
|
求欧美精品网址
|
五月亚洲
|
午夜影院免费在线观看
|
91精品国产亚一区二区三区
|
免费大片黄在线观看
|
成人午夜视频在线观看
|
亚洲爆乳无码一区二区三区
|
手机毛片在线
|
免费精品视频
|
男女男精品视频网站在线观看
|
国产一区系列在线观看
|
国产高清美女一级a毛片久久
|
色噜噜成人综合网站
|
天天摸天天爽天天碰天天弄
|
伊人网国产
|
中文字幕免费视频精品一
|
91亚洲欧美
|
午夜影视剧场
|
亚洲欧美日韩v中文在线
|
91欧美亚洲
|
亚洲一区2区三区4区5区
|
5566中文字幕亚洲精品
|
国产成人免费网站
|
无遮挡免费视频
|
免费人成网址在线观看国内
|
永久免费观看午夜视频在线
|
午夜影院性生活
|
波多野结衣久久国产精品
|