MT4指标能否帮忙用在文华上 [文华财经]
- 咨询内容:
一个布林主图指标,不知道是不是源码,先咨询下。
- 文华技术人员:
您可以发送下源码,我们看是否能够改写。
软件是自带布林指标的,右键--》设置技术指标--》BOLL (布林通道) 加载就可以使用了。
- 文华客服:
/* Generated by EX4-TO-MQ4 decompiler V4.0.224.1 [] Website: http://purebeam.biz E-mail : purebeam@gmail.com*/#property copyright "Copyright ?2006, TrendLaboratory Ltd."#property link "http://finance.groups.yahoo.com/group/TrendLaboratory"
#property indicator_chart_window#property indicator_buffers 6#property indicator_color1 Red#property indicator_color2 Lime#property indicator_color3 Red#property indicator_color4 Lime#property indicator_color5 Red#property indicator_color6 Lime
extern int Length = 21;extern int pp = 0;extern int BandsShift=0;extern double Deviation = 1;extern double MoneyRisk = 0.0;extern int Signal = 1;extern int Line = 1;extern int Nbars = 100000;double g_ibuf_104[];double g_ibuf_108[];double g_ibuf_112[];double g_ibuf_116[];double g_ibuf_120[];double g_ibuf_124[];extern bool SoundON = TRUE;extern bool EmailON=true;extern string shang = "alert.wav";extern string xia= "alert.wav";bool gi_132 = FALSE;bool gi_136 = FALSE;
int init() { SetIndexBuffer(0, g_ibuf_104); SetIndexBuffer(1, g_ibuf_108); SetIndexBuffer(2, g_ibuf_112); SetIndexBuffer(3, g_ibuf_116); SetIndexBuffer(4, g_ibuf_120); SetIndexBuffer(5, g_ibuf_124); SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID); SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID); SetIndexStyle(2, DRAW_ARROW, STYLE_SOLID); SetIndexStyle(3, DRAW_ARROW, STYLE_SOLID); SetIndexStyle(4, DRAW_LINE,STYLE_SOLID); SetIndexStyle(5, DRAW_LINE,STYLE_SOLID); SetIndexArrow(0, 159); SetIndexArrow(1, 159); SetIndexArrow(2, 108); SetIndexArrow(3, 108); IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS)); string ls_0 = "BBands Stop(" + Length + "," + Deviation + ")"; IndicatorShortName(ls_0); SetIndexLabel(0, "UpTrend Stop"); SetIndexLabel(1, "DownTrend Stop"); SetIndexLabel(2, "UpTrend Signal"); SetIndexLabel(3, "DownTrend Signal"); SetIndexLabel(4, "UpTrend Line"); SetIndexLabel(5, "DownTrend Line"); SetIndexDrawBegin(0, Length); SetIndexDrawBegin(1, Length); SetIndexDrawBegin(2, Length); SetIndexDrawBegin(3, Length); SetIndexDrawBegin(4, Length); SetIndexDrawBegin(5, Length); return (0);}
int start() { int li_8; double lda_12[100000]; double lda_16[100000]; double lda_20[100000]; double lda_24[100000]; for (int l_shift_4 = Nbars; l_shift_4 >= 0; l_shift_4--) { g_ibuf_104[l_shift_4] = 0; g_ibuf_108[l_shift_4] = 0; g_ibuf_112[l_shift_4] = 0; g_ibuf_116[l_shift_4] = 0; g_ibuf_120[l_shift_4] = EMPTY_VALUE; g_ibuf_124[l_shift_4] = EMPTY_VALUE; } for (l_shift_4 = Nbars - Length - 1; l_shift_4 >= 0; l_shift_4--) { lda_12[l_shift_4] = iBands(NULL, 0, Length, Deviation, BandsShift, pp, MODE_UPPER, l_shift_4); lda_16[l_shift_4] = iBands(NULL, 0, Length, Deviation, BandsShift, pp, MODE_LOWER, l_shift_4); if (Close[l_shift_4] > lda_12[l_shift_4 + 1]) li_8 = 1; if (Close[l_shift_4] < lda_16[l_shift_4 + 1]) li_8 = -1; if (li_8 > 0 && lda_16[l_shift_4] < lda_16[l_shift_4 + 1]) lda_16[l_shift_4] = lda_16[l_shift_4 + 1]; if (li_8 < 0 && lda_12[l_shift_4] > lda_12[l_shift_4 + 1]) lda_12[l_shift_4] = lda_12[l_shift_4 + 1]; lda_20[l_shift_4] = lda_12[l_shift_4] + (MoneyRisk - 1.0) / 2.0 * (lda_12[l_shift_4] - lda_16[l_shift_4]); lda_24[l_shift_4] = lda_16[l_shift_4] - (MoneyRisk - 1.0) / 2.0 * (lda_12[l_shift_4] - lda_16[l_shift_4]); if (li_8 > 0 && lda_24[l_shift_4] < lda_24[l_shift_4 + 1]) lda_24[l_shift_4] = lda_24[l_shift_4 + 1]; if (li_8 < 0 && lda_20[l_shift_4] > lda_20[l_shift_4 + 1]) lda_20[l_shift_4] = lda_20[l_shift_4 + 1]; if (li_8 > 0) { if (Signal > 0 && g_ibuf_104[l_shift_4 + 1] == -1.0) { g_ibuf_112[l_shift_4] = lda_24[l_shift_4]; g_ibuf_104[l_shift_4] = lda_24[l_shift_4]; if (Line > 0) g_ibuf_120[l_shift_4] = lda_24[l_shift_4]; if (SoundON == TRUE && l_shift_4 == 1 && !gi_132) { Alert("bulin BUY Stop ", Symbol(), "-", Period(),"分钟", Close[0]); if (EmailON) SendMail("布林上升", "布林上升, Period="+Period()+" price="+Close[0]); gi_132 = TRUE; gi_136 = FALSE; } } else { g_ibuf_104[l_shift_4] = lda_24[l_shift_4]; if (Line > 0) g_ibuf_120[l_shift_4] = lda_24[l_shift_4]; g_ibuf_112[l_shift_4] = -1; } if (Signal == 2) g_ibuf_104[l_shift_4] = 0; g_ibuf_116[l_shift_4] = -1; g_ibuf_108[l_shift_4] = -1.0; g_ibuf_124[l_shift_4] = EMPTY_VALUE; } if (li_8 < 0) { if (Signal > 0 && g_ibuf_108[l_shift_4 + 1] == -1.0) { g_ibuf_116[l_shift_4] = lda_20[l_shift_4]; g_ibuf_108[l_shift_4] = lda_20[l_shift_4]; if (Line > 0) g_ibuf_124[l_shift_4] = lda_20[l_shift_4]; if (SoundON == TRUE && l_shift_4 == 1 && !gi_136) { Alert("bulin SELL Stop ", Symbol(), "-", Period(),"分钟", Close[0]); if (EmailON) SendMail("布林向下", "布林向下, Period="+Period()+" price="+Close[0]); gi_136 = TRUE; gi_132 = FALSE; } } else { g_ibuf_108[l_shift_4] = lda_20[l_shift_4]; if (Line > 0) g_ibuf_124[l_shift_4] = lda_20[l_shift_4]; g_ibuf_116[l_shift_4] = -1; } if (Signal == 2) g_ibuf_108[l_shift_4] = 0; g_ibuf_112[l_shift_4] = -1; g_ibuf_104[l_shift_4] = -1.0; g_ibuf_120[l_shift_4] = EMPTY_VALUE; } } return (0);}不知道是不是源码,麻烦老师看看吧,先谢谢老师了 - 网友回复:
抱歉,程序中含有的FOR语句和If循环目前在软件中没有等价的语句可以替换,暂时不能实现改写。
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容