论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
  • 1
  • 2
前往
共 27 条
查看:6507回复:26
草龙
注册时间2004-12-17
[MT4指标]圆周率之顶底预测
楼主发表于:2014-03-03 04:46只看该作者倒序浏览
1楼 电梯直达
电梯直达
附图指标, mt4指标类型:趋势指标 是否能用在mt4手机版上:否 是否含有未来函数:无 //+------------------------------------------------------------------+ //| CycleIdentifier.mq4 | // | //+------------------------------------------------------------------+ #property copyright "" #property link "" #property indicator_separate_window #property indicator_buffers 6 #property indicator_color1 DarkGray #property indicator_color2 Lime #property indicator_color3 Red #property indicator_color4 DarkGreen #property indicator_color5 Brown #property indicator_minimum -1.2 #property indicator_maximum 1.2 extern int PriceActionFilter=1; extern int Length=3; extern int MajorCycleStrength=4; extern bool UseCycleFilter=false; extern int UseFilterSMAorRSI=1; extern int FilterStrengthSMA=12; extern int FilterStrengthRSI=21; double LineBuffer; double MajorCycleBuy; double MajorCycleSell; double MinorCycleBuy; double MinorCycleSell; double ZL1; double CyclePrice = 0.0, Strength =0.0, SweepA = 0.0, SweepB = 0.0; int Switch = 0, Switch2 = 0, SwitchA = 0, SwitchB = 0, SwitchC = 0, SwitchD = 0, SwitchE = 0, SwitchAA = 0, SwitchBB = 0; double Price1BuyA = 0.0, Price2BuyA = 0.0; int Price1BuyB = 1.0, Price2BuyB = 1.0; double Price1SellA = 0.0, Price2SellA = 0.0; int Price1SellB = 0.0, Price2SellB = 0.0; bool ActiveSwitch = True, BuySwitchA = FALSE, BuySwitchB = FALSE, SellSwitchA = FALSE, SellSwitchB = FALSE; int BuySellFac = 01; bool Condition1, Condition2, Condition3, Condition6; int init() { SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2); SetIndexBuffer(0,LineBuffer); SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,3); SetIndexBuffer(1,MajorCycleBuy); SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,3); SetIndexBuffer(2,MajorCycleSell); SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1); SetIndexBuffer(3,MinorCycleBuy); SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,1); SetIndexBuffer(4,MinorCycleSell); SetIndexStyle(5,DRAW_NONE); SetIndexBuffer(5,ZL1); SetIndexEmptyValue(1,0.0); SetIndexEmptyValue(2,0.0); SetIndexEmptyValue(3,0.0); SetIndexEmptyValue(4,0.0); SetIndexEmptyValue(5,0.0); return(0); } int deinit() {return(0);} int start() { int counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); // if(counted_bars>0) counted_bars--; // int position=Bars-1; int position=Bars-counted_bars; if (position<0) position=0; int rnglength = 250; double range = 0.0, srange = 0.0; for (int pos = position; pos >=0; pos--) { srange = 0.0; int j = 0; for (int i=0;i= Bars) break; srange = srange + (High[posr] - Low[posr]); } range = srange / j * Length; int BarNumber = Bars-pos; //?????????? if (BarNumber < 0) BarNumber = 0; CyclePrice = iMA(NULL, 0, PriceActionFilter, 0, MODE_SMMA, PRICE_CLOSE, pos); if (UseFilterSMAorRSI == 1) ZL1[pos] = ZeroLag(CyclePrice,FilterStrengthSMA, pos); if (UseFilterSMAorRSI == 2) ZL1[pos] = ZeroLag( iRSI(NULL, 0, 14, CyclePrice, FilterStrengthRSI ), FilterStrengthRSI, pos); if (ZL1[pos] > ZL1[pos+1]) SwitchC = 1; if (ZL1[pos] < ZL1[pos+1]) SwitchC = 2; if (BarNumber <= 1) { if (Strength == 0) SweepA = range; else SweepA = Strength; Price1BuyA = CyclePrice; Price1SellA = CyclePrice; } /* ***************************************************************** */ if (BarNumber > 1) { if (Switch > -1) { if (CyclePrice < Price1BuyA) { if (UseCycleFilter && (SwitchC == 2) && BuySwitchA ) { MinorCycleBuy[pos + BarNumber - Price1BuyB] = 0; //MinorBuySell LineBuffer[pos + BarNumber - Price1BuyB ] = 0; //line } if (!UseCycleFilter && BuySwitchA) { MinorCycleBuy[pos +BarNumber - Price1BuyB] = 0; LineBuffer[pos +BarNumber - Price1BuyB] = 0; } Price1BuyA = CyclePrice; Price1BuyB = BarNumber; BuySwitchA = TRUE; } else if (CyclePrice > Price1BuyA) { SwitchA = BarNumber - Price1BuyB; if (!UseCycleFilter) { MinorCycleBuy[pos +SwitchA] = -1;//MinorBuySell - DarkGreen LineBuffer[pos +SwitchA] = -1;//line } if (UseCycleFilter && SwitchC == 1) { MinorCycleBuy[pos +SwitchA] = -1; //MinorBuySell LineBuffer[pos +SwitchA] = -1; //line SwitchD = 1; } else { SwitchD = 0; } BuySwitchA = TRUE; double cyclePrice1 = iMA(NULL, 0, PriceActionFilter, 0, MODE_SMMA, PRICE_CLOSE, pos + SwitchA); if (ActiveSwitch) { Condition1 = CyclePrice - cyclePrice1 >= SweepA; } else { Condition1 = CyclePrice >= cyclePrice1 * (1 + SweepA / 1000); } if (Condition1 && SwitchA >= BuySellFac) { Switch = - 1; Price1SellA = CyclePrice; Price1SellB = BarNumber; SellSwitchA = FALSE; BuySwitchA = FALSE; } } } if(Switch < 1) { if (CyclePrice > Price1SellA) { if (UseCycleFilter && SwitchC == 1 && SellSwitchA ) { MinorCycleSell[pos +BarNumber - Price1SellB] = 0; //MinorBuySell LineBuffer[pos +BarNumber - Price1SellB ] = 0; //line } if (!UseCycleFilter && SellSwitchA ) { MinorCycleSell[pos +BarNumber - Price1SellB] = 0;//MinorBuySell LineBuffer[pos +BarNumber - Price1SellB] = 0;//line } Price1SellA = CyclePrice; Price1SellB = BarNumber; SellSwitchA = TRUE; } else if (CyclePrice < Price1SellA) { SwitchA = BarNumber - Price1SellB; if (!UseCycleFilter) { MinorCycleSell[pos +SwitchA] = 1; // MinorBuySell darkRed LineBuffer[pos +SwitchA] = 1; //"CycleLine" } if (UseCycleFilter && (SwitchC == 2)) { MinorCycleSell[pos +SwitchA] = 1;//MinorBuySell darkRed LineBuffer[pos +SwitchA] = 1;//CycleLine SwitchD = 2; } else SwitchD = 0; SellSwitchA = TRUE; double cyclePrice2 = iMA(NULL, 0, PriceActionFilter, 0, MODE_SMMA, PRICE_CLOSE, pos + SwitchA); if (ActiveSwitch) Condition1 = (cyclePrice2 - CyclePrice) >= SweepA; else Condition1 = CyclePrice <= (cyclePrice2 * (1 - SweepA / 1000)); if (Condition1 && SwitchA >= BuySellFac) { Switch = 1; Price1BuyA = CyclePrice; Price1BuyB = BarNumber; SellSwitchA = FALSE; BuySwitchA = FALSE; } } } } LineBuffer[pos] = 0; MinorCycleBuy[pos] = 0; MinorCycleSell[pos] = 0; if (BarNumber == 1) { if (Strength == 0) SweepB = range * MajorCycleStrength; else SweepB = Strength * MajorCycleStrength; Price2BuyA = CyclePrice; Price2SellA = CyclePrice; } if (BarNumber > 1) { if (Switch2 > - 1) { if (CyclePrice < Price2BuyA) { if (UseCycleFilter && SwitchC == 2 && BuySwitchB ) { MajorCycleBuy [pos +BarNumber - Price2BuyB] = 0; //MajorBuySell,green // LineBuffer[pos + BarNumber - Price2BuyB ] = 0; //line ----- } if (!UseCycleFilter && BuySwitchB ) { MajorCycleBuy [pos +BarNumber - Price2BuyB] = 0;//MajorBuySell,green // LineBuffer[pos + BarNumber - Price2BuyB ] = 0; //line----------- } Price2BuyA = CyclePrice; Price2BuyB = BarNumber; BuySwitchB = TRUE; } else if (CyclePrice > Price2BuyA) { SwitchB = BarNumber - Price2BuyB; if (!UseCycleFilter) { MajorCycleBuy [pos +SwitchB] = -1; //MajorBuySell green // LineBuffer[pos + SwitchB] = -1; //line-------------- } if (UseCycleFilter && SwitchC == 1) { MajorCycleBuy [pos +SwitchB] = -1; //MajorBuySell green // LineBuffer[pos + SwitchB] = -1; //line----------------- SwitchE = 1; } else SwitchE = 0; BuySwitchB = TRUE; double cyclePrice3 = iMA(NULL, 0, PriceActionFilter, 0, MODE_SMMA, PRICE_CLOSE, pos + SwitchB); if (ActiveSwitch) Condition6 = CyclePrice - cyclePrice3 >= SweepB; else Condition6 = CyclePrice >= cyclePrice3 * (1 + SweepB / 1000); if (Condition6 && SwitchB >= BuySellFac) { Switch2 = - 1; Price2SellA = CyclePrice; Price2SellB = BarNumber; SellSwitchB = FALSE; BuySwitchB = FALSE; } } } if (Switch2 < 1) { if (CyclePrice > Price2SellA ) { if (UseCycleFilter && SwitchC == 1 && SellSwitchB ) { MajorCycleSell [pos +BarNumber - Price2SellB] = 0; //"MajorBuySell",red // LineBuffer[pos + BarNumber - Price2SellB ] = 0; //line ----- } if (!UseCycleFilter && SellSwitchB ) { MajorCycleSell [pos +BarNumber - Price2SellB] = 0;//"MajorBuySell",red // LineBuffer[pos + BarNumber - Price2SellB ] = 0; //line ----- } Price2SellA = CyclePrice; Price2SellB = BarNumber; SellSwitchB = TRUE; } else if (CyclePrice < Price2SellA) { SwitchB = BarNumber - Price2SellB ; if (!UseCycleFilter) { MajorCycleSell[pos + SwitchB] = 1; //"MajorBuySell",red // LineBuffer[pos + SwitchB ] = 1; //line ----- } if (UseCycleFilter && SwitchC == 2) { MajorCycleSell [pos + SwitchB] = 1; //"MajorBuySell",red // LineBuffer[pos + SwitchB ] = 1; //line ----- SwitchE = 2; } else SwitchE = 0; SellSwitchB = TRUE; double cyclePrice4 = iMA(NULL, 0, PriceActionFilter, 0, MODE_SMMA, PRICE_CLOSE, pos + SwitchB); if (ActiveSwitch) Condition6 = cyclePrice4 - CyclePrice >= SweepB; else Condition6 = CyclePrice <= cyclePrice4 * (1.0 - SweepB / 1000.0); if (Condition6 && SwitchB >= BuySellFac) { Switch2 = 1; Price2BuyA = CyclePrice; Price2BuyB = BarNumber; SellSwitchB = FALSE; BuySwitchB = FALSE; } } } } LineBuffer[pos] = 0; MajorCycleSell[pos] = 0; MajorCycleBuy[pos] = 0; } return(0); } double ZeroLag(double price, int length, int pos) { if (length < 3) { return(price); } double aa = MathExp(-1.414*3.14159 / length); double bb = 2*aa*MathCos(1.414*180 / length); double CB = bb; double CC = -aa*aa; double CA = 1 - CB - CC; double CD = CA*price + CB*ZL1[pos+1] + CC*ZL1[pos+2]; return(CD); }CycleIdentifier2.jpgCycleIdentifier2.jpg
TK29帖子1楼右侧xm竖版广告90-240
个性签名

阅尽天下指标
搬砖开始,始于2014

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
sdlq
注册时间2006-10-15
flyinglala
注册时间2015-04-18
发表于:2015-04-20 11:59只看该作者
3楼
缺钱,灌水赚通宝,谢谢分享!!
个性签名

韬客社区www.talkfx.co

hogdig
注册时间2015-04-16
发表于:2015-08-10 04:18只看该作者
4楼
这个有强烈的未来函数,请楼主不要误导不明正相的群众!!可以用最新版的MT4的测试指标的工具运行一下。
benjom
注册时间2015-08-09
发表于:2015-08-10 04:46只看该作者
5楼
挖槽 看不懂
mikexun
注册时间2015-08-14
发表于:2015-08-15 11:49只看该作者
6楼
楼上的楼上说的好有道理啊!
fjy
注册时间2015-08-06
xiaofeeiyu
注册时间2014-12-14
发表于:2015-10-25 14:18只看该作者
8楼
这个是有未来函数的,会自动重绘。楼主要负责啊。。不能害了其它网友
wangdsdsdsds
注册时间2015-10-26
发表于:2015-10-27 11:44只看该作者
9楼
预测,尖点,但一直不明白这种方式,我们如何去判断他到底是圆点的方法呢
个性签名

韬客社区www.talkfx.co

gunsnw
注册时间2015-01-24
发表于:2015-10-29 08:38只看该作者
10楼
有没有人试过,到底好用不好用
解药
注册时间2015-11-09
stephen898
注册时间2008-11-18
发表于:2016-04-05 13:47只看该作者
12楼
有没有源代码啊
个性签名

稳健投机,积少成多!

jiangyoudeng
注册时间2016-04-06
molitegong
注册时间2016-05-16
混血王子
注册时间2016-06-07
发表于:2016-06-08 18:02只看该作者
15楼
这类的指标网上都有很多,叫心跳指标,肯定有未来函数的
ccs
注册时间2016-04-15
ccs
注册时间2016-04-15
发表于:2016-07-18 08:15只看该作者
17楼
多谢分享
netstray
注册时间2016-12-14
发表于:2016-12-15 11:11只看该作者
19楼
谢谢分享
个性签名

韬客社区www.talkfx.co

广告
论坛谏言--外汇交易不应是你投资的全部,交易外汇也不应是你生活的全部
ericxuhe
注册时间2016-12-25
发表于:2016-12-27 03:33只看该作者
20楼
缺钱,灌水赚通宝,谢谢分享!!
  • 1
  • 2
前往
共 27 条

本站免责声明:

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

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

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

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

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

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