//+--------------------------------------------------------------------------------------+ // 5 D A Y S | // Copyright © RickD BJF Trading Group 2006 | // http://fxstrategy.ca | // | //Experts http://fxstrategy.ca/experts.php SALE! 50% OFF | //Indicators http://fxstrategy.ca/products.php SALE!50% OFF | //Digital Filters Strategy http://fxstrategy.ca/digital_filtrs.php SALE!50% OFF | //Trading Signals http://fxstrategy.ca/signals.php Two weeks FREE! No CC. | // forex calendar, research, article .... | //+--------------------------------------------------------------------------------------+ #property copyright "© RickD BJF Trading Group 2006" #property link "http://fxstrategy.ca/products.php" #property indicator_chart_window #property indicator_buffers 0 extern string __1__ = ""; extern int MaxDays = 20; extern int FontSize = 11; extern string FontName = "Verdana"; extern int Offset = 270; extern string __2__ = ""; extern string Text1 = "Monday"; extern string Text2 = "Tuesday"; extern string Text3 = "Wednesday"; extern string Text4 = "Thursday"; extern string Text5 = "Friday"; extern string __3__ = ""; extern color Color1 = White; extern color Color2 = White; extern color Color3 = White; extern color Color4 = White; extern color Color5 = White; extern string __4__ = ""; extern bool ShowDay1 = true; extern bool ShowDay2 = true; extern bool ShowDay3 = true; extern bool ShowDay4 = true; extern bool ShowDay5 = true; extern bool ShowOnM15 = true; extern bool ShowOnH1 = true; string Text[5]; color Color[5]; bool ShowDay[5]; string prefix = "5days_"; int n; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void init() { 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; ShowDay[0] = ShowDay1; ShowDay[1] = ShowDay2; ShowDay[2] = ShowDay3; ShowDay[3] = ShowDay4; ShowDay[4] = ShowDay5; clear(); show(); } void deinit() { clear(); } void start() { show(); } void show() { int P = Period(); if((ShowOnM15 && P == PERIOD_M15) || (ShowOnH1 && P == PERIOD_H1)) { string name = ""; n = 0; if(P == PERIOD_M15) n = 22; int cnt = MathMin(Bars, PERIOD_D1/P*MaxDays); for (int i=0; i < cnt; i++) { if (TimeDayOfWeek(Time[i]) != TimeDayOfWeek(Time[i+1])) { name = prefix + TimeToStr(Time[i]); int res = ObjectFind(name); if (res == -1) { int day = TimeDayOfWeek(Time[i]); if (!ShowDay[day-1]) continue; ObjectCreate(name, OBJ_TEXT, 0, Time[i-n], High[i]+Offset*Point); ObjectSetText(name, Text[day-1], FontSize, FontName, Color[day-1]); } } } } else return; } void clear() { int P = Period(); if (P > PERIOD_D1) return; string prefix = "5days_"; string name = ""; int cnt = MathMin(Bars, PERIOD_D1/P*MaxDays); for (int i=0; i < cnt; i++) { name = prefix + TimeToStr(Time[i-n]); int res = ObjectFind(name); if (res != -1) ObjectDelete(name); } }