论坛全局菜单下方 - TICKMILL 285X70论坛全局菜单下方 - ThinkMarkets285X70论坛全局菜单下方 - 荔枝返现285X70论坛全局菜单下方 -  icmarkets285X70
查看:993回复:1
草龙
注册时间2004-12-17
[MT4指标]彩色图表系统
楼主发表于:2014-01-10 08:14只看该作者倒序浏览
1楼 电梯直达
电梯直达
//+------------------------------------------------------------------+ //| Affichage JOUR.mq4 | //| Copyright 2007, GwadaTradeBoy Corp. | //| [email protected] | //+------------------------------------------------------------------+ //| i-5days.mq4 | //| Copyright 2007, RickD | //| www.e2e-fx.net | //+------------------------------------------------------------------+ #property copyright "Copyright 2007, GwadaTradeBoy Corp." #property link "[email protected]" #property copyright " RickD 2006" #property link "www.e2e-fx.net" //---- #define major 1 #define minor 0 //---- #property indicator_chart_window extern string __1__ = ""; extern int MaxDays = 20; extern int FontSize = 16; extern string FontName = "System"; extern int Offset = 16; extern string __2__ = ""; /*//--- Fran愀椀猀 extern string Text1 = "Lun"; extern string Text2 = "Mar"; extern string Text3 = "Mer"; extern string Text4 = "Jeu"; extern string Text5 = "Ven"; --- English extern string Text1 = "mon"; extern string Text2 = "tue"; extern string Text3 = "wed"; extern string Text4 = "thu"; extern string Text5 = "fri";*/ //--- Portuguese-Brazilian extern string Text1 = "seg"; extern string Text2 = "ter"; extern string Text3 = "qua"; extern string Text4 = "qui"; extern string Text5 = "sex"; extern string __3__ = ""; extern color Color1 = DodgerBlue; extern color Color2 = DeepPink; extern color Color3 = ForestGreen; extern color Color4 = FireBrick; extern color Color5 = MediumPurple; extern string __4__ = ""; extern bool ShowDay1 = true; extern bool ShowDay2 = true; extern bool ShowDay3 = true; extern bool ShowDay4 = true; extern bool ShowDay5 = true; extern string __5__ = ""; extern bool ShowDayBox = true; extern color DayColor1 = SkyBlue; extern color DayColor2 = Pink; extern color DayColor3 = SpringGreen; extern color DayColor4 = LightCoral; extern color DayColor5 = Plum; //---- string Text[5]; color Color[5]; bool ShowDay[5]; string prefix = "5days_"; //---- Variables - Affichage jour int P, cnt, i, res, day; string name = ""; //---- Variables - Affichage rectangle datetime DateTrade, TimeBeginObject, TimeEndObject; int counted_bars, BarBegin, BarEnd, ResObject; double PriceHighObject, PriceLowObject; string NameObject; color DayColor[5]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators Text[0] = Text1; Text[1] = Text2; Text[2] = Text3; Text[3] = Text4; Text[4] = Text5; //---- Color[0] = Color1; Color[1] = Color2; Color[2] = Color3; Color[3] = Color4; Color[4] = Color5; DayColor[0] = DayColor1; DayColor[1] = DayColor2; DayColor[2] = DayColor3; DayColor[3] = DayColor4; DayColor[4] = DayColor5; //---- ShowDay[0] = ShowDay1; ShowDay[1] = ShowDay2; ShowDay[2] = ShowDay3; ShowDay[3] = ShowDay4; ShowDay[4] = ShowDay5; //---- clear(); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- clear(); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { counted_bars=IndicatorCounted(); P = Period(); //---- if(P > PERIOD_D1) return; cnt = MathMin(Bars, PERIOD_D1 / P * MaxDays); for(i=0; i < cnt; i++) { if(TimeDayOfWeek(Time) != TimeDayOfWeek(Time[i+1])) { name = prefix + TimeToStr(Time); res = ObjectFind(name); if(res == -1) { day = TimeDayOfWeek(Time); if(!ShowDay[day-1]) continue; ObjectCreate(name, OBJ_TEXT, 0, Time, High + Offset * Point); ObjectSetText(name, Text[day-1], FontSize, FontName, Color[day-1]); } if(ShowDayBox && P <= PERIOD_H4) { //---- Définition des variables NameObject = "DayBox"+i; DateTrade = TimeCurrent(); //---- Calcul des valeurs courantes TimeBeginObject = Time; switch(Period()) { case PERIOD_M1: TimeEndObject = Time[i+1440]; break; case PERIOD_M5: TimeEndObject = Time[i+288]; break; case PERIOD_M15: TimeEndObject = Time[i+96]; break; case PERIOD_M30: TimeEndObject = Time[i+48]; break; case PERIOD_H1: TimeEndObject = Time[i+24]; break; case PERIOD_H4: TimeEndObject = Time[i+6]; break; } BarBegin=iBarShift(NULL, 0, TimeBeginObject); BarEnd=iBarShift(NULL, 0, TimeEndObject); PriceHighObject = High[iHighest(NULL, 0, MODE_HIGH, BarBegin - BarEnd, BarEnd)]; PriceLowObject=Low [iLowest (NULL, 0, MODE_LOW , BarBegin - BarEnd, BarEnd)]; //---- Dessin du rectangle ObjectCreate(NameObject, OBJ_RECTANGLE, 0, TimeBeginObject, PriceHighObject, TimeEndObject, PriceLowObject); ObjectSet(NameObject, OBJPROP_STYLE, STYLE_SOLID); ObjectSet(NameObject, OBJPROP_COLOR, DayColor[day-1]); ObjectSet(NameObject, OBJPROP_BACK, True); } } } //---- return(0); } //+------------------------------------------------------------------+ //---- void clear() { P = Period(); if(P > PERIOD_D1) return; cnt = MathMin(Bars, PERIOD_D1 / P * MaxDays); for(i=0; i < cnt; i++) { name = prefix + TimeToStr(Time); NameObject = "DayBox"+i; res = ObjectFind(name); ResObject = ObjectFind(NameObject); if(res != -1) ObjectDelete(name); if(ResObject != -1) ObjectDelete(NameObject); } }Affichage%20JOUR.jpgAffichage%20JOUR.jpg
TK29帖子1楼右侧xm竖版广告90-240
个性签名

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

广告
TK30+TK31帖子一樓廣告
TK30+TK31帖子一樓廣告
牛可
注册时间2018-04-04

本站免责声明:

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

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

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

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

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

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