您現(xiàn)在的位置:程序化交易>> 期貨公式>> 文華財經(jīng)>> 文華財經(jīng)知識>>正文內(nèi)容

[求助]能不能將下面的轉(zhuǎn)成文華6的主圖指標(biāo)? [文華財經(jīng)]

  • 咨詢內(nèi)容: ?//+------------------------------------------------------------------+//|? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? WATR.mq4? |//|? ? ? ? ? ? ? ? ? ? ? Written WizardSerg under article konkop in? |//|? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? "Modern trading" #4/2001? |//|? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? http://www.wizardserg.inweb.ru? |//|? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? wizardserg@mail.ru? |//+------------------------------------------------------------------+#property copyright "Written WizardSerg under article konkop in <Modern trading> #4/2001"#property link? ? ? "http://www.wizardserg.inweb.ru"http://----#property indicator_chart_window#property indicator_buffers 2#property indicator_color1 Coral#property indicator_color2 DodgerBlue//---- input parametersextern int? ? WATR_K = 10;extern double WATR_M = 4.0;extern int? ? ATR = 21;//---- buffersdouble ExtMapBufferUp[];double ExtMapBufferDown[];//+------------------------------------------------------------------+//| Custom indicator initialization function? ? ? ? ? ? ? ? ? ? ? ? ?|//+------------------------------------------------------------------+int init()? {??? ?IndicatorBuffers(2);??? ?SetIndexBuffer(0, ExtMapBufferUp);?? ?ArraySetAsSeries(ExtMapBufferUp, true);? ? ??? ?SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);? ?SetIndexBuffer(1, ExtMapBufferDown);?? ?ArraySetAsSeries(ExtMapBufferDown, true);? ? ??? ?SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);? ?IndicatorShortName("WATR(" + WATR_K + ", " + WATR_M + ")");?? ?SetIndexLabel(0, "WATR_Up");? ?SetIndexLabel(1, "WATR_Dn");? ??? ?return(0);?? }//+------------------------------------------------------------------+//| Custom indicator deinitialization function? ? ? ? ? ? ? ? ? ? ? ?|//+------------------------------------------------------------------+int deinit()? {//----? ?return(0);? }//+------------------------------------------------------------------+//| Custom indicator function? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |//+------------------------------------------------------------------+bool AntiTrendBar(int i)? {? ?bool res = (TrendUp(i) && (Close[i] < Open[i])) ||? ? ? ? ?? ? ? ? ? ? ? (!TrendUp(i) && (Close[i] > Open[i]));? ??? ?return(res);? }//+------------------------------------------------------------------+//| Custom indicator function? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |//+------------------------------------------------------------------+double CalcIndicValue(int i, bool trend)? {? ?double res = Close[i];??? ?if(trend)? ? ? ?res -= (WATR_K*Point + WATR_M*iATR(NULL, 0, ATR, i));? ?else? ? ? ?res += (WATR_K*Point + WATR_M*iATR(NULL, 0, ATR, i));? ? ? ??? ?return(res);? }//+------------------------------------------------------------------+//| Custom indicator function? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |//+------------------------------------------------------------------+bool TrendUp(int i)? {? ?return((Close[i+1] > ExtMapBufferUp[i+1]) &&?? ? ? ? ? (ExtMapBufferUp[i+1] != EMPTY_VALUE));? }//+------------------------------------------------------------------+//| Custom indicator iteration function? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |//+------------------------------------------------------------------+int start()? {? ?int limit;? ?int counted_bars = IndicatorCounted();//---- 鐿耠邃龕?鐿聹栩囗睇?徉?狍溴?镥皰聹栩囗//---- 镥疴鑠 珥圜屙楨 檜滂賅蠑疣 == 鰣礤-1 point,?//? ? ?蠑 羼螯 聹栩噱?蝠屙?忸聃鈿?? ?ExtMapBufferUp[Bars-1] = Close[Bars-1] - WATR_K*Point;? ? ?// limit = (counted_bars > 0) ? (Bars - counted_bars) : (Bars - 1);? ?limit = Bars - counted_bars;? ?if(counted_bars==0) limit-=2;//---- 鋮眍忭鉍 鯊覿? ?for(int i = limit; i >= 0; i--)? ? ?{? ? ? ?if(AntiTrendBar(i))? ? ? ? ?{? ? ? ? ? ?ExtMapBufferUp[i] = ExtMapBufferUp[i+1];? ? ? ? ? ??? ? ? ? ? ?ExtMapBufferDown[i] = ExtMapBufferDown[i+1];? ? ? ? ? ??? ? ? ? ?}? ? ? ?else? ? ? ? ?{? ? ? ? ? ?if(TrendUp(i))? ? ? ? ? ? ?{? ? ? ? ? ? ? ?ExtMapBufferUp[i] = CalcIndicValue(i, true);? ? ? ? ? ? ? ?if(ExtMapBufferUp[i] < ExtMapBufferUp[i+1])? ? ? ? ? ? ? ? ? ?ExtMapBufferUp[i] = ExtMapBufferUp[i+1];? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ?ExtMapBufferDown[i] = EMPTY_VALUE;?? ? ? ? ? ? ?}? ? ? ? ? ?else? ? ? ? ? ? ?{? ? ? ? ? ? ? ?ExtMapBufferDown[i] = CalcIndicValue(i, false);? ? ? ? ? ? ? ? ? ? ? ??? ? ? ? ? ? ? ?if(ExtMapBufferDown[i] > ExtMapBufferDown[i+1])? ? ? ? ? ? ? ? ? ?ExtMapBufferDown[i] = ExtMapBufferDown[i+1];? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ?ExtMapBufferUp[i] = EMPTY_VALUE;? ? ? ? ? ? ?}? ? ? ? ?}? ? ? ?// 镥皰皴麇龕 ?鰣眍?? ? ? ? ? ? ? ??? ? ? ?if(TrendUp(i) && (Close[i] < ExtMapBufferUp[i]))? ? ? ? ?{? ? ? ? ? ?ExtMapBufferDown[i] = CalcIndicValue(i, false);??? ? ? ? ? ?ExtMapBufferUp[i] = EMPTY_VALUE;? ? ? ? ?}? ? ? ?if((!TrendUp(i)) && (Close[i] > ExtMapBufferDown[i]))? ? ? ? ?{? ? ? ? ? ?ExtMapBufferUp[i] = CalcIndicValue(i, true);? ? ? ? ? ? ? ? ??? ? ? ? ? ?ExtMapBufferDown[i] = EMPTY_VALUE;?? ? ? ? ?}? ? ?}? ?return(0);? }//+------------------------------------------------------------------+

    ?

    ?來源:程序化99

  • 文華技術(shù)人員: ?wh6是基礎(chǔ)看盤軟件,不支持循環(huán)這樣復(fù)雜的思路的
    您可以具體說明下思路,我們看下是否可以直接編寫

 

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

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


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

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 中国少妇无码专区| 亚洲精品乱码久久久久久按摩 | 欧美一级专区免费大片| 你懂的手机在线视频| 美女内射毛片在线看3D | 日韩在线视频不卡一区二区三区| 亚洲精品一区二区三区四区乱码| 精品丝袜人妻久久久久久 | 国产原创精品视频| 99久久99久久精品国产片| 孕妇videos孕交| 中文字幕一区二区三区免费视频| 日本大片在线看黄a∨免费 | 色偷偷狠狠色综合网| 国产国产成人精品久久| 性一交一乱一伧老太| 国产精品美女www爽爽爽视频| 99久久精品免费视频| 天天在线综合网| 一区二区三区午夜| 性欧美18-19sex性高清播放| 中文字幕在线高清| 日本中文字幕有码在线视频| 久久无码精品一区二区三区| 最新国产精品自拍| 亚洲AV无码久久| 极品色αv影院| 亚洲一区精品无码| 欧美人与性囗牲恔配| 亚洲国产精品日韩在线| 欧美日韩视频在线成人| 亚洲欧美国产精品专区久久| 69视频在线观看高清免费| 欧美丝袜一区二区三区| 亚洲欧美日韩国产精品专区| 狠狠久久永久免费观看| 免费看大黄高清网站视频在线| 精品少妇ay一区二区三区| 啊轻点灬大ji巴太粗太长了免费 | 国产香蕉在线视频一级毛片 | 朝鲜女人性猛交|