麥語(yǔ)言的編程思維實(shí)在轉(zhuǎn)不過(guò)來(lái),請(qǐng)老師幫我改下 [文華財(cái)經(jīng)]

  • 咨詢內(nèi)容: 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兩條線

     

  • 文華技術(shù)人員:

     查看了一下您的源碼,代碼是不完整的,缺少變量Multiplier定義部分。

    您的公式是MT4指標(biāo)吧。請(qǐng)?zhí)峁┫峦暾创a,以便我們?yōu)槟薷摹?/p>

     

  • 文華客服:  這個(gè)不影響就一個(gè)變量
    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兩條線

     

  • 網(wǎng)友回復(fù):  我們研究一下,MT4改寫需要一些時(shí)間。改寫好后會(huì)第一時(shí)間為您回復(fù)。

     

  • 網(wǎng)友回復(fù): 老師,您好,我的程序改好沒有?

 

有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友

可聯(lián)系技術(shù)人員 QQ: 511411198  點(diǎn)擊這里給我發(fā)消息進(jìn)行 有償 編寫!不貴!點(diǎn)擊查看價(jià)格!


【字體: 】【打印文章】【查看評(píng)論

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 中文字幕日产无码| 免费a级毛视频| 91午夜精品亚洲一区二区三区| 无遮挡一级毛片性视频不卡| 亚洲国产成人久久综合碰碰动漫3d| 精品国产青草久久久久福利| 国产最爽的乱淫视频国语对| 99福利在线观看| 成人禁在线观看| 亚洲AV日韩精品久久久久久| 男人边摸边吃奶边做下面| 国产乱子伦农村xxxx| 亚洲人成色77777在线观看| 精品视频www| 国产成人综合洲欧美在线| 99久久无色码中文字幕人妻蜜柚| 无码中文字幕av免费放| 亚洲ts人妖网站| 浮力国产第一页| 又粗又大又猛又爽免费视频| 黄页网址大全免费观看35| 成人毛片18女人毛片免费| 亚洲JIZZJIZZ中国少妇中文| 污污的视频在线免费观看| 国产日产一区二区三区四区五区| aa级毛片毛片免费观看久| 成年在线网站免费观看无广告| 乱爱性全过程免费视频| 欧美精品stoya在线| 免费精品99久久国产综合精品 | a级毛片免费高清视频| 无码一区二区三区AV免费 | 韩国爸爸的朋友10整有限中字| 国产精品夜夜爽范冰冰| 99精品久久久中文字幕| 尤物永久免费AV无码网站| 久久99国产精品久久99小说 | 87福利电影网| 夜夜精品无码一区二区三区| 一级做a爱视频| 我和小雪在ktv被一群男生小说|