大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频75-大伊香蕉在线精品视频人碰人

您現在的位置:程序化交易>> 期貨公式>> 文華財經>> 文華財經知識>>正文內容

麥語言的編程思維實在轉不過來,請老師幫我改下 [文華財經]

  • 咨詢內容: 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改寫需要一些時間。改寫好后會第一時間為您回復。

     

  • 網友回復: 老師,您好,我的程序改好沒有?

 

有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友

可聯系技術人員 QQ: 511411198  點擊這里給我發消息進行 有償 編寫!不貴!點擊查看價格!


【字體: 】【打印文章】【查看評論

相關文章

    沒有相關內容
主站蜘蛛池模板: 亚洲视频污 | 麻豆亚洲一区 | 国产福利久久 | 国产视频福利在线 | 天天操天天操 | 波霸欧美性猛交xxxxxx | 女人精69xxxxx免费无毒 | 韩国色三级伦不卡高清在线观看 | 精品亚洲无人区一区二区 | 幸福宝色多多 | 日韩欧美一二区 | 国产99在线视频 | 香蕉综合在线 | 日韩激情中文字幕一区二区 | 日韩成人免费 | 久久天天操 | 91亚洲精品成人一区 | bt 另类 专区 欧美 制服 | 久久69| 天堂毛片| 国产草草 | 久草视频免费播放 | 久久的爱久久久久的快乐 | 中文字幕日韩精品亚洲七区 | 色狠狠色综合吹潮 | 色中色资源站 | 欧美成人xx免费视频 | 中国美女一级a毛片录像在线 | 久久厕所精品国产精品亚洲 | 在线成人爽a毛片免费软件 在线成人天天鲁夜啪视频 在线成人亚洲 | 亚洲欧美乱综合图片区小说区 | 波多野结衣免费一区二区三区香蕉 | 亚洲精品伊人久久久久 | 九9热这里真品 | 七色永久性tv网站免费看 | 久久精品国产亚洲欧美 | 久久国产免费观看精品 | 欧美日韩国产一区二区三区 | 亚洲一区精品视频在线 | 欧美成人看片黄a免费 | 久久这里只有精品66 |