人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看

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

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

  • 咨詢內容: 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  點擊這里給我發消息進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 成年男女男免费视频网站不卡 | 一级理论片免费观看在线 | 国产资源在线视频 | 中文字幕成人免费高清在线视频 | 在线观看国产区 | 国产一国产一级毛片视频在线 | 中文字幕视频免费 | 91精品国产乱码在线观看 | pornh日本xxxxhd | 曰批视频免费 | 国产91在线看 | 欧美成人a级在线视频 | 无遮羞禁黄动漫在线观看 | 国产清纯91天堂在线观看 | 久久精品国产欧美日韩亚洲 | 韩国伦理片在线免费观看 | 久久综合丁香激情久久 | 免费视频成人国产精品网站 | 国产精品 日韩 | 亚洲免费色视频 | 三级伦理片高清在线观看播放 | 欧美另类日韩中文色综合 | 最近中文字幕免费版在线3 最近中文字幕免费版在线 最近中文字幕免费mv在线视频 | 污污的免费视频 | 午夜看片网址 | 欧美在线区| 欧美日韩中文字幕在线手机版本 | 成人免费网站视频ww | 中国一级毛片国产高清 | 伊人网国产 | 黄色天堂网 | 午夜资源网 | 免费一级a毛片在线播放视 免费一级a毛片在线播出 | 精品一区二区三区在线视频观看 | 亚洲福利天堂网福利在线观看 | 成人毛片免费观看 | 毛片动态 | 久久网色 | 国产欧美日韩综合精品无毒 | 国产精品一区二区三区高清在线 | 免费精品一区二区三区第35 |