论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
帖子
作者
回复/查看
最后发表
2008-08-07 15:24
82
27153
2018-07-11 04:46
原帖由 汇聚一堂 于 2009-8-19 10:16 发表 http://www.talkfx.com/images/common/back.gif forest2006老大,能做成模板就好了,现在都不知如何引用。谢谢
对不起,我忽略了论坛的背景码.现在又重新打包了一下,有需要的同学下载后解压到mt4相应的文件夹中,再重打开一下mt4,调用"顺势短线系统"模板即可 其实这三个指标都是别人在2007年发过的.顺势短线系统.rar
2009-08-19 08:30
它实质就是均线系统. 看到这东西还有人这么推崇, 就把它的源码弄来放在下面 :lol (为符合tk的坛规,删除了某论坛的地址广告和时间限制):lol 1. 顺势超短线指标.mq4
//+------------------------------------------------------------------+ //| 顺势超短线指标.mq4 | //| Copyright ?2007 | //| http: | //+------------------------------------------------------------------+ #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Aqua #property indicator_color2 Tomato extern int period = 21; extern int method = 3; extern int price = 0; double g_ibuf_88; double g_ibuf_92; double g_ibuf_96; int init() { IndicatorBuffers(3); SetIndexBuffer(0, g_ibuf_88); SetIndexBuffer(1, g_ibuf_92); SetIndexBuffer(2, g_ibuf_96); ArraySetAsSeries(g_ibuf_96, TRUE); SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2); SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2); IndicatorShortName("顺势超短线指标(" + period + ")"); return (0); } int deinit() { return (0); } double WMA(int ai_0, int a_period_4) { return (iMA(NULL, 0, a_period_4, 0, method, price, ai_0)); } int start() { double lda_16; double lda_20; int l_ind_counted_0 = IndicatorCounted(); if (l_ind_counted_0 < 0) return (-1); int li_4 = 0; int l_period_8 = MathSqrt(period); int li_12 = Bars - l_ind_counted_0 + period + 1; if (li_12 > Bars) li_12 = Bars; ArrayResize(lda_16, li_12); ArraySetAsSeries(lda_16, TRUE); ArrayResize(lda_20, li_12); ArraySetAsSeries(lda_20, TRUE); for (li_4 = 0; li_4 < li_12; li_4++) lda_16[li_4] = 2.0 * WMA(li_4, period / 2) - WMA(li_4, period); for (li_4 = 0; li_4 < li_12 - period; li_4++) g_ibuf_96[li_4] = iMAOnArray(lda_16, 0, l_period_8, 0, method, li_4); for (li_4 = li_12 - period; li_4 >= 0; li_4--) { lda_20[li_4] = lda_20[li_4 + 1]; if (g_ibuf_96[li_4] > g_ibuf_96[li_4 + 1]) lda_20[li_4] = 1; if (g_ibuf_96[li_4] < g_ibuf_96[li_4 + 1]) lda_20[li_4] = -1; if (lda_20[li_4] > 0.0) { g_ibuf_88[li_4] = g_ibuf_96[li_4]; if (lda_20[li_4 + 1] < 0.0) g_ibuf_88[li_4 + 1] = g_ibuf_96[li_4 + 1]; g_ibuf_92[li_4] = EMPTY_VALUE; } else { if (lda_20[li_4] < 0.0) { g_ibuf_92[li_4] = g_ibuf_96[li_4]; if (lda_20[li_4 + 1] > 0.0) g_ibuf_92[li_4 + 1] = g_ibuf_96[li_4 + 1]; g_ibuf_88[li_4] = EMPTY_VALUE; } } } return (0); } //------------------------------------------------- 2. 顺势短线多空指标.mq4
//+------------------------------------------------------------------+ //| 顺势短线多空指标.mq4 | //| Copyright ?2007, MetaQuotes Software Corp. | //|
http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property indicator_separate_window #property indicator_minimum -0.05 #property indicator_maximum 1.05 #property indicator_buffers 2 #property indicator_color1 White #property indicator_color2 DarkOrange extern int MaMetod = 1; extern int MaPeriod = 40; extern int SoundAlertMode = 1; double g_ibuf_88; double g_ibuf_92; double g_ibuf_96; double g_ibuf_100; double g_ibuf_104; int gi_108 = 0; bool gi_112 = FALSE; bool gi_116 = FALSE; int init() { IndicatorBuffers(5); SetIndexStyle(0, DRAW_HISTOGRAM); SetIndexBuffer(0, g_ibuf_88); SetIndexStyle(1, DRAW_HISTOGRAM); SetIndexBuffer(1, g_ibuf_92); SetIndexBuffer(2, g_ibuf_96); SetIndexBuffer(3, g_ibuf_100); SetIndexBuffer(4, g_ibuf_104); SetIndexDrawBegin(0, 10); SetIndexDrawBegin(1, 10); return (0); } int deinit() { return (0); } int start() { double l_ima_0; double l_ima_8; double l_ima_16; double l_ima_24; double ld_32; double ld_40; double ld_48; double ld_56; string ls_68; if (Bars <= 10) return (0); gi_108 = IndicatorCounted(); if (gi_108 < 0) return (-1); if (gi_108 > 0) gi_108--; for (int li_64 = Bars - gi_108 - 1; li_64 >= 0; li_64--) { l_ima_0 = iMA(NULL, 0, MaPeriod, 0, MaMetod, PRICE_CLOSE, li_64); l_ima_8 = iMA(NULL, 0, MaPeriod, 0, MaMetod, PRICE_LOW, li_64); l_ima_16 = iMA(NULL, 0, MaPeriod, 0, MaMetod, PRICE_OPEN, li_64); l_ima_24 = iMA(NULL, 0, MaPeriod, 0, MaMetod, PRICE_HIGH, li_64); ld_32 = (g_ibuf_96[li_64 + 1] + (g_ibuf_100[li_64 + 1])) / 2.0; ld_56 = (l_ima_0 + l_ima_24 + l_ima_16 + l_ima_8) / 4.0; ld_40 = MathMax(l_ima_24, MathMax(ld_32, ld_56)); ld_48 = MathMin(l_ima_16, MathMin(ld_32, ld_56)); if (ld_32 < ld_56) { g_ibuf_104[li_64] = 1; g_ibuf_88[li_64] = 0; g_ibuf_92[li_64] = 1; if (SoundAlertMode > 0 && li_64 == 0 && g_ibuf_104[1] < 0.0) PlaySound("alert2.wav"); } else { g_ibuf_104[li_64] = -1; g_ibuf_88[li_64] = 1; g_ibuf_92[li_64] = 0; if (SoundAlertMode > 0 && li_64 == 0 && g_ibuf_104[1] > 0.0) PlaySound("alert2.wav"); } g_ibuf_96[li_64] = ld_32; g_ibuf_100[li_64] = ld_56; } if (g_ibuf_104[2] < 0.0 && g_ibuf_104[1] > 0.0 && Volume[0] > 1.0 && !gi_112) { ls_68 = " " + Symbol() + " M" + Period() + ": 买入信号"; if (SoundAlertMode > 0) Alert(ls_68); gi_112 = TRUE; gi_116 = FALSE; } if (g_ibuf_104[2] > 0.0 && g_ibuf_104[1] < 0.0 && Volume[0] > 1.0 && !gi_116) { ls_68 = " " + Symbol() + " M" + Period() + ": 卖出信号"; if (SoundAlertMode > 0) Alert(ls_68); gi_116 = TRUE; gi_112 = FALSE; } return (0); } //------------------------------------- 3. 顺势超短线趋势指标.mq4
//+------------------------------------------------------------------+ //| 顺势超短线趋势指标.mq4 | //| Copyright ?2007 | //| http: | //+------------------------------------------------------------------+ #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Lime #property indicator_color2 Red extern int MA = 24; extern int MA_Mode = 2; extern int MA_Price = 0; extern double Step = 0.02; extern double Maximum = 0.08; extern bool Alert_Sound = TRUE; double g_ibuf_108; double g_ibuf_112; int gi_116; int gi_120; double gd_124; double gd_132; double gd_140; double gd_148; double gd_156; bool gi_164 = TRUE; int gi_168 = 0; int g_time_172 = 0; int init() { SetIndexStyle(0, DRAW_ARROW); SetIndexArrow(0, 159); SetIndexBuffer(0, g_ibuf_108); SetIndexStyle(1, DRAW_LINE); SetIndexBuffer(1, g_ibuf_112); return (0); } void SaveLastReverse(int ai_0, int ai_4, double ad_8, double ad_16, double ad_24, double ad_32, double ad_40) { gi_116 = ai_0; gi_120 = ai_4; gd_124 = ad_8; gd_140 = ad_16; gd_132 = ad_24; gd_148 = ad_32; gd_156 = ad_40; } int start() { bool li_0; double ld_4; double ld_12; double ld_20; double ld_28; double ld_36; double ld_44; double ld_52; double ld_60; int l_ind_counted_72 = IndicatorCounted(); for (int li_68 = 0; li_68 < Bars - MA - 2; li_68++) g_ibuf_112[li_68] = iMA(NULL, 0, MA, 0, MA_Mode, MA_Price, li_68); if (Bars < 0) return (0); li_68 = Bars - 2; if (l_ind_counted_72 == 0 || gi_164) { gi_164 = TRUE; li_0 = TRUE; ld_4 = Step; ld_12 = -10000000.0; ld_20 = 10000000.0; while (li_68 > 0) { gi_116 = li_68; ld_44 = g_ibuf_112[li_68]; if (ld_20 > ld_44) ld_20 = ld_44; ld_52 = g_ibuf_112[li_68]; if (ld_12 < ld_52) ld_12 = ld_52; if (ld_52 > g_ibuf_112[li_68 + 1] && ld_44 > g_ibuf_112[li_68 + 1]) break; if (ld_52 < g_ibuf_112[li_68 + 1] && ld_44 < g_ibuf_112[li_68 + 1]) { li_0 = FALSE; break; } li_68--; } for (int li_76 = li_68; li_76 < Bars; li_76++) g_ibuf_108[li_76] = 0.0; if (li_0) { g_ibuf_108[li_68] = g_ibuf_112[li_68 + 1]; ld_28 = g_ibuf_112[li_68]; } else { g_ibuf_108[li_68] = g_ibuf_112[li_68 + 1]; ld_28 = g_ibuf_112[li_68]; } li_68--; } else { li_68 = gi_116; ld_4 = gd_124; li_0 = gi_120; ld_12 = gd_132; ld_20 = gd_140; ld_28 = gd_148; ld_36 = gd_156; } while (li_68 >= 0) { ld_44 = g_ibuf_112[li_68]; ld_52 = g_ibuf_112[li_68]; if (li_0 && ld_44 < g_ibuf_108[li_68 + 1]) { SaveLastReverse(li_68, 1, ld_4, ld_44, ld_12, ld_28, ld_36); ld_4 = Step; li_0 = FALSE; ld_28 = ld_44; ld_20 = ld_44; g_ibuf_108[li_68] = ld_12; li_68--; continue; } if (!li_0 && ld_52 > g_ibuf_108[li_68 + 1]) { SaveLastReverse(li_68, 0, ld_4, ld_20, ld_52, ld_28, ld_36); ld_4 = Step; li_0 = TRUE; ld_28 = ld_52; ld_12 = ld_52; g_ibuf_108[li_68] = ld_20; li_68--; continue; } ld_60 = g_ibuf_108[li_68 + 1]; ld_36 = ld_60 + ld_4 * (ld_28 - ld_60); if (li_0) { if (ld_28 < ld_52 && ld_4 + Step <= Maximum) ld_4 += Step; if (ld_52 < g_ibuf_112[li_68 + 1] && li_68 == Bars - 2) ld_36 = g_ibuf_108[li_68 + 1]; ld_60 = g_ibuf_112[li_68 + 1]; if (ld_36 > ld_60) ld_36 = ld_60; ld_60 = g_ibuf_112[li_68 + 2]; if (ld_36 > ld_60) ld_36 = ld_60; if (ld_36 > ld_44) { SaveLastReverse(li_68, 1, ld_4, ld_44, ld_12, ld_28, ld_36); ld_4 = Step; li_0 = FALSE; ld_28 = ld_44; ld_20 = ld_44; g_ibuf_108[li_68] = ld_12; li_68--; continue; } if (ld_28 < ld_52) { ld_12 = ld_52; ld_28 = ld_52; } } else { if (ld_28 > ld_44 && ld_4 + Step <= Maximum) ld_4 += Step; if (ld_44 < g_ibuf_112[li_68 + 1] && li_68 == Bars - 2) ld_36 = g_ibuf_108[li_68 + 1]; ld_60 = g_ibuf_112[li_68 + 1]; if (ld_36 < ld_60) ld_36 = ld_60; ld_60 = g_ibuf_112[li_68 + 2]; if (ld_36 < ld_60) ld_36 = ld_60; if (ld_36 < ld_52) { SaveLastReverse(li_68, 0, ld_4, ld_20, ld_52, ld_28, ld_36); ld_4 = Step; li_0 = TRUE; ld_28 = ld_52; ld_12 = ld_52; g_ibuf_108[li_68] = ld_20; li_68--; continue; } if (ld_28 > ld_44) { ld_20 = ld_44; ld_28 = ld_44; } } g_ibuf_108[li_68] = ld_36; li_68--; } if (Time[0] <= g_time_172 && 1) return (0); g_time_172 = Time[0]; if (gi_168 <= 0) if (Close[1] - g_ibuf_108[1] > 0.0) gi_168 = 1; if (gi_168 >= 0) if (g_ibuf_108[1] - Close[1] > 0.0) gi_168 = -1; return (0); } //-------------------------------------------------------
2009-08-18 18:49
2008-02-13 14:33
44
2893
2008-02-14 01:45
2008-02-13 16:29
2008-02-07 13:22
41
3207
2008-02-07 16:04
2008-01-20 19:32
14
1033
2008-01-20 23:58
2008-01-20 23:01
2008-01-11 12:21
21
4047
2011-12-29 02:17
2008-01-13 03:37
2007-12-01 12:44
53
21411
2019-01-01 13:35
2007-12-19 14:47
2007-12-19 13:16
137
6489
2007-12-27 00:40
2007-12-19 13:52

本站免责声明:

1、本站所有广告及宣传信息均与韬客无关,如需投资请依法自行决定是否投资、斟酌资金安全及交易亏损风险;

2、韬客是独立的、仅为投资者提供交流的平台,网友发布信息不代表韬客的观点与意思表示,所有因网友发布的信息而造成的任何法律后果、风险与责任,均与韬客无关;

3、金融交易存在极高法律风险,未必适合所有投资者,请不要轻信任何高额投资收益的诱导而贸然投资;投资保证金交易导致的损失可能超过您投入的资金和预期。请您考虑自身的投资经验及风险承担能力,进行合法、理性投资;

4、所有投资者的交易帐户应仅限本人使用,不应交由第三方操作,对于任何接受第三方喊单、操盘、理财等操作的投资和交易,由此导致的任何风险、亏损及责任由投资者个人自行承担;

5、韬客不隶属于任何券商平台,亦不受任何第三方控制,韬客不邀约客户投资任何保证金交易,不接触亦不涉及投资者的任何资金及账户信息,不代理任何交易操盘行为,不向客户推荐任何券商平台,亦不存在其他任何推荐行为。投资者应自行选择券商平台,券商平台的任何行为均与韬客无关。投资者注册及使用韬客即表示其接受和认可上述声明,并自行承担法律风险。

版权所有:韬客外汇论坛 www.talkfx.com 联络我们:[email protected]