人人爽天天爽夜夜爽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改寫需要一些時間。改寫好后會第一時間為您回復。
網友回復:
老師,您好,我的程序改好沒有?
打印本文
關閉窗口
主站蜘蛛池模板:
欧美护士激情第一欧美精品
|
日本一区二区三区中文字幕视频
|
亚洲第一免费视频
|
污91视频
|
欧美一区二区另类有声小说
|
久久国产偷
|
国产欧美精品国产国产专区
|
久久99精品波多结衣一区
|
欧美日韩中文字幕在线手机版本
|
国产v综合v亚洲欧美大另类
|
美女在线观看网站
|
欧美精品福利在线视频
|
2022国产精品手机在线观看
|
一级片一区
|
青青青国产依人在线视频97
|
羞羞视频在线看免费
|
午夜影院色
|
一本无线乱码不卡一二三四
|
亚洲一区二区三区在线免费观看
|
天天天天做夜夜夜做
|
欧美成人剧情中文字幕
|
欧美性猛交xxx嘿人猛交
|
久久午夜网
|
国产农村三片免费网站
|
国产一级特黄一级毛片
|
99久久亚洲
|
日韩精品中文字幕一区三区
|
亚洲最大在线视频
|
男女羞羞视频免费看
|
国内一卡2卡三卡四卡在线 国外欧美一区另类中文字幕
|
日韩在线观看免费
|
国产精品v欧美精品v日韩精品
|
你懂的在线视频播放
|
www91在线观看
|
欧美日韩片
|
国产午夜精品不卡观看
|
天天操天天干天天射
|
国产高清在线精品一区a
|
天天射天天射天天射
|
久热这里只精品热在线观看
|
丁香欧美
|