论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:1301回复:1
草龙
注册时间2004-12-17
[MT4指标]KasePeakOscilator-KPO指标
楼主发表于:2014-06-10 22:30只看该作者倒序浏览
1楼 电梯直达
电梯直达
附图指标, mt4指标类型:趋势指标 是否能用在mt4手机版上:否 是否含有未来函数:无 //+------------------------------------------------------------------+ //| KasePeakOscilator_v1.mq4 | //| Kalenzo | //| [email protected] | //+------------------------------------------------------------------+ #property copyright "Kalenzo" #property link "[email protected]" #property indicator_buffers 3 #property indicator_color1 Green #property indicator_color2 Red #property indicator_color3 Yellow extern int KPeriod = 30; extern int BarsToCalculate = 300; double RWHL; double Pk; double PkGreen; double PkRed; double MN; double SD; double v1,v2; double Line; #property indicator_separate_window //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators IndicatorBuffers(7); SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,1); SetIndexBuffer(0,PkGreen); SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,1); SetIndexBuffer(1,PkRed); SetIndexStyle(2,DRAW_LINE,EMPTY,1); SetIndexBuffer(2,Line); SetIndexBuffer(3,RWHL); SetIndexBuffer(4,MN); SetIndexBuffer(5,SD); SetIndexBuffer(6,Pk); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { //---- int limit = BarsToCalculate; //---- for(int i = 0; i <= limit; i++) { double H = (High-Low[i+KPeriod])/(iATR(Symbol(),0,KPeriod,i)*MathSqrt(KPeriod)); double L = (High[i+KPeriod]-Low)/(iATR(Symbol(),0,KPeriod,i)*MathSqrt(KPeriod)); RWHL = H - L; } for(int p = 0; p <= limit; p++) Pk = iMAOnArray(RWHL,0,3,0,MODE_LWMA,p); for(int m = 0; m <= limit; m++) MN[m] = iMAOnArray(Pk,0,KPeriod,0,MODE_SMA,m); for(int s = 0; s <= limit; s++) SD[s] = iStdDevOnArray(Pk,0,KPeriod,MODE_SMA,0,s); for(int v = 0; v <= limit; v++) { if(MN[v]+(1.33*SD[v])>2.08) v1 = MN[v]+(1.33*SD[v]); else v1 = 2.08; if(MN[v]-(1.33*SD[v])<-1.92) v2 = MN[v]-(1.33*SD[v]); else v2 = -1.92; if(Pk[v+1]>Pk[v]) { PkRed[v] = Pk[v]; PkGreen[v] = 0; } else { PkRed[v] = 0; PkGreen[v] = Pk[v]; } if(Pk[v+1] >= 0 && Pk[v] > 0) { Line[v] = v1; } else { if(Pk[v+1] <= 0 && Pk[v] < 0) { Line[v] = v2; } else { Line[v] = 0; } } } //---- return(0); } //+------------------------------------------------------------------+//+------------------------------------------------------------------+ //| Kanal_Ant.mq4 | //| Copyright ? 2005, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //| red. Stajer59, http://www.stajer59.ucoz.ru | //| (orig.: Envelopes.mq4) | //+------------------------------------------------------------------+ #property copyright "Copyright ? 2005, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" //---- indicator settings #property indicator_chart_window #property indicator_buffers 7 #property indicator_color1 Blue #property indicator_color2 Red #property indicator_color3 Blue #property indicator_color4 Red #property indicator_color5 Blue #property indicator_color6 Red #property indicator_color7 Teal //---- indicator parameters extern int BarsCount = 500; extern int MA_Period=55; extern int MA_Shift=0; extern int MA_Method=0; extern int Applied_Price=0; extern int fontsize=7; extern double Deviation=1; //---- indicator buffers double ExtMapBuffer1; double ExtMapBuffer2; double ExtMapBuffer3; double ExtMapBuffer4; double ExtMapBuffer5; double ExtMapBuffer6; double ExtMapBuffer7; //---- int ExtCountedBars=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { int draw_begin; string short_name; //---- drawing settings SetIndexStyle(0,DRAW_LINE); SetIndexStyle(1,DRAW_LINE); SetIndexStyle(2,DRAW_LINE); SetIndexStyle(3,DRAW_LINE); SetIndexStyle(4,DRAW_LINE,OBJPROP_WIDTH,2); SetIndexStyle(5,DRAW_LINE,OBJPROP_WIDTH,2); SetIndexStyle(6,DRAW_LINE,OBJPROP_WIDTH,2); SetIndexShift(0,MA_Shift); SetIndexShift(1,MA_Shift); SetIndexShift(2,MA_Shift); SetIndexShift(3,MA_Shift); SetIndexShift(4,MA_Shift); SetIndexShift(5,MA_Shift); SetIndexShift(6,MA_Shift); IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)); if(MA_Period<2) MA_Period=14; draw_begin=MA_Period-1; //---- indicator short name IndicatorShortName("Env("+MA_Period+")"); SetIndexLabel(0,"Env("+MA_Period+")U1"); SetIndexLabel(1,"Env("+MA_Period+")D1"); SetIndexLabel(2,"Env("+MA_Period+")U2"); SetIndexLabel(3,"Env("+MA_Period+")D2"); SetIndexLabel(4,"Env("+MA_Period+")U3"); SetIndexLabel(5,"Env("+MA_Period+")D3"); SetIndexLabel(6,"MA("+MA_Period+")"); SetIndexDrawBegin(0,draw_begin); SetIndexDrawBegin(1,draw_begin); SetIndexDrawBegin(2,draw_begin); SetIndexDrawBegin(3,draw_begin); SetIndexDrawBegin(4,draw_begin); SetIndexDrawBegin(5,draw_begin); SetIndexDrawBegin(6,draw_begin); //---- indicator buffers mapping SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer(1,ExtMapBuffer2); SetIndexBuffer(2,ExtMapBuffer3); SetIndexBuffer(3,ExtMapBuffer4); SetIndexBuffer(4,ExtMapBuffer5); SetIndexBuffer(5,ExtMapBuffer6); SetIndexBuffer(6,ExtMapBuffer7); ObjectCreate("l1", OBJ_TEXT, 0, 0, 0); ObjectSetText("l1", "U1",fontsize,"Arial",Blue); ObjectCreate("l2", OBJ_TEXT, 0, 0, 0); ObjectSetText("l2", "D1",fontsize,"Arial",Red); ObjectCreate("l3", OBJ_TEXT, 0, 0, 0); ObjectSetText("l3", "U2",fontsize,"Arial",Blue); ObjectCreate("l4", OBJ_TEXT, 0, 0, 0); ObjectSetText("l4", "D2",fontsize,"Arial",Red); ObjectCreate("l5", OBJ_TEXT, 0, 0, 0); ObjectSetText("l5", "U3",fontsize,"Arial",Blue); ObjectCreate("l6", OBJ_TEXT, 0, 0, 0); ObjectSetText("l6", "D3",fontsize,"Arial",Red); ObjectCreate("l7", OBJ_TEXT, 0, 0, 0); ObjectSetText("l7", "LB",fontsize,"Arial",Teal); if(Deviation<0.1) Deviation=0.1; if(Deviation>100.0) Deviation=100.0; //---- initialization done return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { ObjectDelete("l1"); ObjectDelete("l2"); ObjectDelete("l3"); ObjectDelete("l4"); ObjectDelete("l5"); ObjectDelete("l6"); ObjectDelete("l7"); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int limit; if(Bars<=MA_Period) return(0); ExtCountedBars=IndicatorCounted(); //---- check for possible errors if (ExtCountedBars<0) return(-1); //---- last counted bar will be recounted if (ExtCountedBars>0) ExtCountedBars--; limit=Bars-ExtCountedBars; //---- EnvelopesM counted in the buffers for(int i=0; iKasePeakOscilator_v1.jpg
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
Pzxzx
注册时间2017-08-06

本站免责声明:

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

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

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

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

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

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