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

[求助]能不能將下面的轉成文華6的主圖指標? [文華財經]

  • 咨詢內容: ?//+------------------------------------------------------------------+//|? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 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

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

 

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

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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 天堂网www天堂在线资源| 春暖花开亚洲性无区一区二区| 国产亚洲午夜高清国产拍精品| 97精品国产高清自在线看超| 无码国产乱人伦偷精品视频| 亚洲国产成人久久综合一区| 精品一区二区三区在线观看视频| 国产又黄又爽胸又大免费视频| 91精品啪在线观看国产线免费| 成人免费网站在线观看| 么公的又大又深又硬想要| 污视频免费网站| 向日葵app下载观看免费| 欧美另类xxxxx极品| 在线观看免费污视频| 中文字幕23页| 日美欧韩一区二去三区| 亚洲国产情侣一区二区三区| 男女一边摸一边做爽视频| 国产一区二区三区在线免费观看 | 免费污网站在线观看| 足鞋臭脚袜奴交小说h| 国产精品中文字幕在线| 99无码精品二区在线视频| 成人免费视频网| 久久免费国产视频| 欧洲精品码一区二区三区免费看| 亚洲精品国精品久久99热一| 精品黑人一区二区三区| 国产伦精品一区二区三区精品 | 国内精品一卡2卡3卡4卡三卡| 一级毛片在线免费视频| 日本视频免费高清一本18| 亚洲不卡在线观看| 欧美老熟妇欲乱高清视频| 免费人成在线观看网站 | 女人18特级一级毛片免费视频| 久久99国产视频| 日韩影片在线观看| 亚洲中文字幕无码av在线| 欧美激情第1页|