论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:700回复:2
草龙
注册时间2004-12-17
[MT4指标]FFS_CrossTiming指标
楼主发表于:2014-09-17 06:29只看该作者倒序浏览
1楼 电梯直达
电梯直达
附图指标, mt4指标类型:趋势指标 是否能用在mt4手机版上:否 是否含有未来函数:无 //+------------------------------------------------------------------+ //| FFS_CrossTiming.mq4 | //| Release date 20070128 | //+------------------------------------------------------------------+ #property copyright \"icm63 (user name at Forex-TSD)\" #property link \"Forex-TSD\" //+---------------------------------------------------------------------------------------------------+ //| | //| READ ME FIRST. | //| I have nothing to do with www.forexforsmarties.com. | //| You use these tools at YOUR OWN RISK. | //| I do not endorse or sell FFS methods or products in any way. | //| These tools are provided FREE of charge, I wish to promote the development of MT4 tools and minds| //| of those who trade FFS to get the best \'How to FFS tools\'. So we all can trade FFS thru easy | //| and tough times. As the Forex market gives and takes away fortunes ! To make 5% monthly | //| compounding over 10 years is not easy when the forex beast changes. | //| | //| Use with | //| FFS_Trend | //| FFS_Correlation | //| FFS_Cross | //| FFS_NetPipChange | //| | //| IMPORTANT: | //| Make sure the \'IndexType\' is the same within each MT4 tool. | //| The FFS_Mode should be set as BUY, to mirror the FFS Calcutator. | //| | //| Like the FFS_Correlation tool, this is a fundamental watch. It shows the combined trend of | //| all the crosses related to the hedge pair in question. All cross have been adjusted to be on | //| the same price scale and treated as equal weight. | //| | //| When this start getting wild so will the accounts trading FFS, and settings will have to be | //| adjusted for survival. Use the FFS_Trainspotter (in FFS_Trend) to see FFS_NetPipChange summary | //| to view the extremes of the net pip swings of the hedge pairs. | //| | //| This is the index selection format | //| 1. EUR/USD, USD/CHF | //| 2. EUR/USD, USD/CHF, GBP/USD | //| 3. EUR/USD, USD/CHF, GBP/USD, USD/JPY | //| 4. EUR/USD, USD/CHF, USD/JPY | //| 5. EUR/USD, GBP/USD, USD/JPY | //| 6. USD/CHF, GBP/USD | //| 7. USD/CHF, GBP/USD, USD/JPY | //| 8. GBP/USD, USD/JPY | //+---------------------------------------------------------------------------------------------------+ #property indicator_separate_window #property indicator_buffers 3 //---- #property indicator_color1 Red #property indicator_color2 DarkGreen #property indicator_color3 Lime //---- #property indicator_level1 60 #property indicator_level2 40 //User Inputs Parameters extern int IndexType=9; // FFS Index see above extern int CCI=5; //CCI period extern double Lag1_Gamma=0.5; //Laguerre Gamma Short extern double Lag2_Gamma=0.8; //Laguerre Gamma Long //---- variables double cross1; double CCI1; double Lag1; double Lag2; double normCCI1; double normcross1; string shortname; //---- Laguerra Variables double L0A=0; double L1A=0; double L2A=0; double L3A=0; double L0=0; double L1=0; double L2=0; double L3=0; double CU=0; double CD=0; double LRSI=0; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { shortname=\"FFS_CrossTiming Index \" + IndexType + \", CCI Red (\"+CCI+ \"), Laguerre(\"+DoubleToStr(Lag1_Gamma,1)+\",\"+DoubleToStr(Lag2_Gamma,1)+\"), \"; //---- IndicatorShortName(shortname); IndicatorBuffers(6); //---- SetIndexDrawBegin(0,CCI+1); SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,normCCI1); SetIndexLabel(0, \"CCI1\"); SetIndexDrawBegin(1,5); SetIndexEmptyValue(1, -0.01); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,Lag1); SetIndexLabel(1, \"Lag1\"); SetIndexDrawBegin(2,5); SetIndexEmptyValue(2, -0.01); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,Lag2); SetIndexLabel(2, \"Lag2\"); SetIndexBuffer(3,cross1); SetIndexBuffer(4,CCI1); SetIndexBuffer(5,normcross1); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { int limit; int counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars-=1; limit=Bars-counted_bars; //---- double EURCHFW, GBPCHFW, EURJPYW, GBPJPYW, CHFJPYW, EURGBPW; //Determine correct weight to get all prices on scale of 10,000 EURCHFW=(10000/(iClose(\"EURCHF\",0,1)*10000))*10000; GBPCHFW=(10000/(iClose(\"GBPCHF\",0,1)*10000))*10000; EURJPYW=(10000/(iClose(\"EURJPY\",0,1)*10000))*10000; GBPJPYW=(10000/(iClose(\"GBPJPY\",0,1)*10000))*10000; CHFJPYW=(10000/(iClose(\"CHFJPY\",0,1)*10000))*10000; EURGBPW=(10000/(iClose(\"EURGBP\",0,1)*10000))*10000; //---- for(int i=limit; i>=0; i--) { switch(IndexType) { case 1: //1. EUR/USD, USD/CHF\" cross1= iClose(\"EURCHF\",0,i) * EURCHFW; break; case 2: //2. EUR/USD, USD/CHF, GBP/USD cross1= iClose(\"EURCHF\",0,i) * EURCHFW + iClose(\"GBPCHF\",0,i) * GBPCHFW + iClose(\"EURGBP\",0,i) * EURGBPW; break; case 3: //3. EUR/USD, USD/CHF, GBP/USD, USD/JPY cross1= iClose(\"EURCHF\",0,i) * EURCHFW + iClose(\"GBPCHF\",0,i) * GBPCHFW + iClose(\"EURJPY\",0,i) * EURJPYW + iClose(\"GBPJPY\",0,i) * GBPJPYW + iClose(\"CHFJPY\",0,i) * CHFJPYW + iClose(\"EURGBP\",0,i) * EURGBPW ; break; case 4: //4. EUR/USD, USD/CHF, USD/JPY cross1= iClose(\"EURCHF\",0,i) * EURCHFW + iClose(\"EURJPY\",0,i) * EURJPYW + iClose(\"CHFJPY\",0,i) * CHFJPYW ; break; case 5: //5. EUR/USD, GBP/USD, USD/JPY cross1= iClose(\"EURJPY\",0,i) * EURJPYW + iClose(\"GBPJPY\",0,i) * GBPJPYW + iClose(\"EURGBP\",0,i) * EURGBPW ; break; case 6: //6. USD/CHF, GBP/USD cross1= iClose(\"GBPCHF\",0,i) * GBPCHFW ; break; case 7: //7. USD/CHF, GBP/USD, USD/JPY cross1= iClose(\"GBPCHF\",0,i) * GBPCHFW + iClose(\"GBPJPY\",0,i) * GBPJPYW + iClose(\"CHFJPY\",0,i) * CHFJPYW ; break; case 8: //8. GBP/USD, USD/JPY cross1= iClose(\"GBPJPY\",0,i) * GBPJPYW ; break; case 9: //9. Chart Symbol cross1= iClose(NULL,0,i) ; break; default: //3. EUR/USD, USD/CHF, GBP/USD, USD/JPY cross1= iClose(\"EURCHF\",0,i) * EURCHFW + iClose(\"GBPCHF\",0,i) * GBPCHFW + iClose(\"EURJPY\",0,i) * EURJPYW + iClose(\"GBPJPY\",0,i) * GBPJPYW + iClose(\"CHFJPY\",0,i) * CHFJPYW + iClose(\"EURGBP\",0,i) * EURGBPW ; break; } //Find Max and Min or series double Maxcross1=-10000000, Mincross1=10000000; for(int k=0; k Maxcross1) Maxcross1=cross1[i+k]; if(cross1[i+k] < Mincross1) Mincross1=cross1[i+k]; } } //Normalise Data btw 0 and 100 for(int m=limit; m>=0; m--) { if (Maxcross1 - Mincross1!=0) normcross1[m]=NormalizeDouble(100*(cross1[m]-Mincross1)/(Maxcross1-Mincross1),2); } //INDICATORS FOR NORMALISED CROSSES DATA FOR ENTRY AND EXIT TIMING FOR FFS TRADES //Calculate CCI and Laguerre arrays if(CCI > 0) { for(int g=limit; g>=0; g--) { CCI1[g]=iCCIOnArray(normcross1,limit,CCI,g); //Red Lag1[g]=LaguerreRSI(normcross1[g],Lag1_Gamma); } for(int y=limit; y>=0; y--) { Lag2[y]=LaguerreRSI(normcross1[y],Lag2_Gamma); } } NormaliseSeries(CCI1,normCCI1,limit); //---- return(0); } //+------------------------------------------------------------------+ //|FUNCTIONS | //+------------------------------------------------------------------+ void NormaliseSeries(double& InData, double& OutData, int limit) { double nMax= -10000000; double nMin= 10000000; //---- for( int k=0; k nMax) nMax=InData[k]; if(InData[k] < nMin) nMin=InData[k]; } //Normalise Data btw Min and Max for(int m=limit; m>=0; m--) { if (nMax - nMin!=0) OutData[m]=NormalizeDouble(100*((InData[m]-nMin)/(nMax-nMin)),2); } } //+------------------------------------------------------------------+ //|Laguerre calc | //+------------------------------------------------------------------+ double LaguerreRSI(double InData, double gamma) { L0A=L0; L1A=L1; L2A=L2; L3A=L3; L0=(1 - gamma)* InData + gamma* L0A; L1=- gamma * L0 + L0A + gamma * L1A; L2=- gamma * L1 + L1A + gamma * L2A; L3=- gamma * L2 + L2A + gamma * L3A; //---- CU=0; CD=0; //---- if(L0>=L1) CU=L0 - L1; else CD=L1 - L0; //---- if(L1>=L2) CU=CU + L1 - L2; else CD=CD + L2 - L1; //---- if(L2>=L3) CU=CU + L2 - L3; else CD=CD + L3 - L2; //---- if(CU + CD!=0) LRSI=NormalizeDouble((CU/(CU + CD))* 90,2); return(LRSI); } //+------------------------------------------------------------------+
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
rimonky
注册时间2014-11-29
发表于:2015-07-05 09:52只看该作者
2楼
感谢分享
个性签名

韬客社区www.talkfx.co

Pzxzx
注册时间2017-08-06

本站免责声明:

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

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

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

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

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

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