0_-_Weekly__Open_y_Targets
Download scriptThis script is designed for the MetaTrader 4 platform to provide traders with a comprehensive visual overview of key price levels across multiple timeframes (Daily, Weekly, and Monthly). Instead of requiring the user to manually calculate or look up historical highs and lows, the tool automatically plots these significant price points directly on the trading chart.
Core Functionality
The logic follows a multi-layered approach to identify and display market boundaries:
1. Historical Price Boundaries The script scans back through history (based on a user-defined count of days) to identify and draw lines for:
- Daily Highs and Lows: Marks the extreme points reached during previous trading sessions.
- Weekly Highs and Lows: Identifies the price boundaries for previous weeks.
- Monthly Highs and Lows: Tracks the broader extremes of the current month.
2. Dynamic Target Calculation A unique feature of this script is its ability to project "Target" levels based on Weekly data. It identifies the opening price of the previous week and projects specific profit-taking or risk-management zones (Long and Short targets) by adding or subtracting a user-defined point value from that price.
3. Real-Time Current Session Tracking The tool provides live updates for the current trading periods. It can draw rectangles or lines that represent the "live" range of:
- The current day's price action.
- The current week's price movement.
- The current month's price movement.
4. Pivot Point Analysis Beyond simple highs and lows, the script includes logic to calculate and display Pivot Points for Daily, Weekly, and Monthly timeframes. These are calculated using the standard formula (Average of High + Low + Close of the previous period), helping traders identify potential areas of support and resistance.
Visual Customization
To ensure the chart remains readable, the script includes several organizational features:
- Toggleable Visibility: Users can choose to turn specific elements (like labels, rectangles, or specific timeframes) on or off depending on their trading style.
- Customizable Styling: The logic allows for different line styles, widths, and colors for each timeframe, ensuring that Daily data does not clutter the view of Weekly or Monthly trends.
- Automatic Cleanup: The script includes a dedicated "Object Delete" function. This ensures that as new data is generated, old lines are removed from the chart, keeping the workspace clean and up-to-date without manual intervention.
Summary for the User
Essentially, this tool acts as an automated "map" for your chart. It instantly highlights where the market has been (Previous Highs/Lows), where it is currently moving (Current Rectangles), and where key technical levels sit (Pivots and Targets), allowing for faster decision-making during live trading.
//+------------------------------------------------------------------+
//| MTF_HI_LOW_v1.mq4 |
//| Copyright © 2006, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
// Weekly Open + Targets: Modifications by File45 - http://codebase.mql4.com/en/author/file45
#property indicator_chart_window
extern int CountDays=110;
//extern bool Show_LABELS = true;
bool Show_W_Hi_Lo_Labels = false;
bool Show_CurrDaily = false;
int Shift_CurrDaily_LABEL = -100;
bool Show_CurrWeekly = true;
int Shift_CurrWeekly_LABEL = 0;
bool Show_CurrMonthly = false;
int Shift_CurrMonthly_LABEL = -1000;
color line_color_CurrDailyUPPER = CLR_NONE;
color line_color_CurrDailyLOWER = CLR_NONE;
//color line_color_CurrWeeklyUPPER = Lime;
color line_color_CurrWeeklyLOWER = Red;
color line_color_CurrMonthlyUPPER = CLR_NONE;
color line_color_CurrMonthyLOWER = CLR_NONE;
int CurrDaily_LineStyle = 2;
int CurrWeekly_LineStyle = 1;
int CurrMonthly_LineStyle = 4;
//extern int Line_Width = 0;
bool Show_PreviousDaily = false;
bool Xtend_Prev_DailyLine = false;
bool Show_PreviousWeekly = true;
bool Xtend_Prev_WeeklyLine = false;
bool Show_PreviousMonthly = false;
bool Xtend_Prev_MonthlyLine = false;
color line_color_PreviousDaily = CLR_NONE;
color line_color_PreviousWeekly = Gold;
extern color Weekly_Open = LightSlateGray;
color line_color_PerviousWeekLow = CLR_NONE;
color line_color_PreviousMonthly = Red;
//extern int Line_Style = 0;
//extern int Line_Width = 2;
//extern int Shift_Prev_LABEL =3;
extern color TP_Long_Target = Green;
extern color TP_Short_Target = Red;
extern int TP_Target = 500;
bool Show_LABELS = false;
int Label_Size = 10;
int Shift_Prev_LABEL =-3;
extern int Line_Style = 0;
extern int Line_Width = 2;
bool Show_CurrRectangles_Display = false;
bool Show_Rectangles = false;
bool Rectangle_Curr_DayPeriod_only = false;
bool Show_Daily_Rectangle = false;
color Daily_Rectangle_color = CLR_NONE;
bool Show_Weekly_Rectangle = true;
color Weekly_Rectangle_color = CLR_NONE;
bool Show_Monthly_Rectangle = false;
color Monthly_Rectangle_color = CLR_NONE;
bool Show_Daily_Pivots = false;
int Daily_Pivot_color = CLR_NONE;
int Daily_Pivot_LineWidth = 1;
bool Show_Weekly_Pivots = false;
int Weekly_Pivot_color = Yellow;
int Weekly_Pivot_LineWidth = 1;
bool Show_Monthly_Pivots = false;
int Monthly_Pivot_color = CLR_NONE;
int Monthly_Pivot_LineWidth = 1;
int ShiftPivot_LABELS = 10;
#define Curr_DG "Curr_DG"
#define Curr_WG "Curr_WG"
#define Curr_MG "Curr_MG"
datetime time1;
datetime time2;
datetime time3;
datetime time4;
datetime time5;
datetime time6;
//******************************
//currTimes
datetime time7;
datetime time8;
datetime time9;
datetime time10;
datetime time11;
datetime time12;
//********************************
//Pivot
datetime time13;
datetime time14;
datetime time15;
datetime time16;
datetime time17;
datetime time18;
double DHi,DLo,WHi,WHi_TP_L,WHi_TP_S,WLo,MHi,MLo;
double DHigh,DLow,WHigh,WLow,MHigh,MLow;
double highD,lowD,closeD,highW,lowW,closeW,highM,lowM,closeM;
double PD,PW,PM;
int shift, num;
void ObjDel()
{
for (;num<=CountDays;num++)
{
ObjectDelete("Previous_DailyHi["+num+"]");
ObjectDelete("Previous_DailyLo["+num+"]");
ObjectDelete("Previous_WeeklyHi["+num+"]");
ObjectDelete("Previous_WeeklyLo["+num+"]");
ObjectDelete("PW_TP_Long["+num+"]");
ObjectDelete("PW_TP_Short["+num+"]");
ObjectDelete("Previous_MonthlyHi["+num+"]");
ObjectDelete("Previous_MonthlyLo["+num+"]");
ObjectDelete("CurrentDailyHi["+num+"]");
ObjectDelete("CurrentDailyLo["+num+"]");
ObjectDelete("CurrentWeeklyHi["+num+"]");
ObjectDelete("CurrentWeeklyLo["+num+"]");
ObjectDelete("CurrentMonthlyHi["+num+"]");
ObjectDelete("CurrentMonthlyLo["+num+"]");
ObjectDelete("HILO2");
ObjectDelete("HILO3");
ObjectDelete("HILO2P");
ObjectDelete("HILO3P");
//*****************
//Pivot
ObjectDelete("CurrentPivot["+num+"]");
ObjectDelete("CurrentWeeklylyPivot["+num+"]");
ObjectDelete("CurrentMonthlyPivot["+num+"]");
}
}
void PlotLineD(string dname,double value,double line_color_Daily,double style)
{
ObjectCreate(dname,OBJ_TREND,0,time1,value,time2,value);
ObjectSet(dname, OBJPROP_WIDTH, 1);
ObjectSet(dname, OBJPROP_STYLE, Line_Style);
ObjectSet(dname, OBJPROP_RAY, Xtend_Prev_DailyLine);
ObjectSet(dname, OBJPROP_BACK, true);
ObjectSet(dname, OBJPROP_COLOR, line_color_Daily);
}
void PlotLineW(string wname,double value,double line_color_Weekly,double style)
{
ObjectCreate(wname,OBJ_TREND,0,time3,value,time4,value);
ObjectSet(wname, OBJPROP_WIDTH, Line_Width);
ObjectSet(wname, OBJPROP_STYLE, Line_Style);
ObjectSet(wname, OBJPROP_RAY, Xtend_Prev_WeeklyLine);
ObjectSet(wname, OBJPROP_BACK, true);
ObjectSet(wname, OBJPROP_COLOR, line_color_Weekly);
}
void PlotLineWL(string wlname,double value,double TP_Long_Target,double style)
{
ObjectCreate(wlname,OBJ_TREND,0,time3,value,time4,value);
ObjectSet(wlname, OBJPROP_WIDTH, Line_Width);
ObjectSet(wlname, OBJPROP_STYLE, Line_Style);
ObjectSet(wlname, OBJPROP_RAY, Xtend_Prev_WeeklyLine);
ObjectSet(wlname, OBJPROP_BACK, true);
ObjectSet(wlname, OBJPROP_COLOR, TP_Long_Target);
}
void PlotLineWS(string wsname,double value,double TP_Short_Target,double style)
{
ObjectCreate(wsname,OBJ_TREND,0,time3,value,time4,value);
ObjectSet(wsname, OBJPROP_WIDTH, Line_Width);
ObjectSet(wsname, OBJPROP_STYLE, Line_Style);
ObjectSet(wsname, OBJPROP_RAY, Xtend_Prev_WeeklyLine);
ObjectSet(wsname, OBJPROP_BACK, true);
ObjectSet(wsname, OBJPROP_COLOR, TP_Short_Target);
}
/* void PlotLineM(string mname,double value,double line_color_Monthly,double style)
{
//ObjectCreate(mname,OBJ_TREND,0,time5,value,time6,value);
ObjectSet(mname, OBJPROP_WIDTH, 1);
ObjectSet(mname, OBJPROP_STYLE, Line_Style);
ObjectSet(mname, OBJPROP_RAY, Xtend_Prev_MonthlyLine);
ObjectSet(mname, OBJPROP_BACK, true);
ObjectSet(mname, OBJPROP_COLOR, line_color_Monthly);
}*/
//****************************************************************************************
// CurrDaily levels
void PlotLineDLY(string dayname,double value,double col,double style)
{
ObjectCreate(dayname,OBJ_TREND,0,time7,value,time8,value);
ObjectSet(dayname, OBJPROP_WIDTH, 1);
ObjectSet(dayname, OBJPROP_STYLE, CurrDaily_LineStyle );
ObjectSet(dayname, OBJPROP_RAY, false);
ObjectSet(dayname, OBJPROP_BACK, true);
ObjectSet(dayname, OBJPROP_COLOR, col);
}
/* void PlotLineWLY(string weekname,double value,double col,double style)
{
ObjectCreate(weekname,OBJ_TREND,0,time9,value,time10,value);
ObjectSet(weekname, OBJPROP_WIDTH, 1);
ObjectSet(weekname, OBJPROP_STYLE, CurrWeekly_LineStyle );
ObjectSet(weekname, OBJPROP_RAY, false);
ObjectSet(weekname, OBJPROP_BACK, true);
ObjectSet(weekname, OBJPROP_COLOR, col);
}*/
void PlotLineMLY(string monthname,double value,double col,double style)
{
ObjectCreate(monthname,OBJ_TREND,0,time11,value,time12,value);
ObjectSet(monthname, OBJPROP_WIDTH, 1);
ObjectSet(monthname, OBJPROP_STYLE, CurrMonthly_LineStyle );
ObjectSet(monthname, OBJPROP_RAY, false);
ObjectSet(monthname, OBJPROP_BACK, true);
ObjectSet(monthname, OBJPROP_COLOR, col);
}
void PlotLinePVT(string pname,double value,double col,double style)
{
ObjectCreate(pname,OBJ_TREND,0,time13,value,time14,value);
ObjectSet(pname, OBJPROP_WIDTH, Daily_Pivot_LineWidth);
ObjectSet(pname, OBJPROP_STYLE, 0 );
ObjectSet(pname, OBJPROP_RAY, false);
ObjectSet(pname, OBJPROP_BACK, true);
ObjectSet(pname, OBJPROP_COLOR, col);
}
void PlotLinePVTW(string wpname,double value,double col,double style)
{
ObjectCreate(wpname,OBJ_TREND,0,time15,value,time16,value);
ObjectSet(wpname, OBJPROP_WIDTH, Weekly_Pivot_LineWidth);
ObjectSet(wpname, OBJPROP_STYLE, 0 );
ObjectSet(wpname, OBJPROP_RAY, false);
ObjectSet(wpname, OBJPROP_BACK, true);
ObjectSet(wpname, OBJPROP_COLOR, col);
}
void PlotLinePVTM(string mpname,double value,double col,double style)
{
ObjectCreate(mpname,OBJ_TREND,0,time17,value,time18,value);
ObjectSet(mpname, OBJPROP_WIDTH, Monthly_Pivot_LineWidth);
ObjectSet(mpname, OBJPROP_STYLE, 0 );
ObjectSet(mpname, OBJPROP_RAY, false);
ObjectSet(mpname, OBJPROP_BACK, true);
ObjectSet(mpname, OBJPROP_COLOR, col);
}
int init()
{
IndicatorShortName("MTF_HI_LOW");
return(0);
}
int deinit()
{
ObjectsDeleteAll(0,OBJ_RECTANGLE);
ObjectsDeleteAll(0,OBJ_TRENDBYANGLE);
ObjectsDeleteAll(0,OBJ_TEXT);
ObjDel();
Comment("");
return(0);
}
int start()
//*******************************************************************************************
{
CreateDHI();
}
void Create_DailyLineHI(string dLine, double start, double end,double w, double s,color clr)
{
ObjectCreate(dLine, OBJ_RECTANGLE, 0, iTime(NULL,1440,0), start, Time[0], end);
ObjectSet(dLine, OBJPROP_COLOR, clr);
ObjectSet(dLine,OBJPROP_RAY,false);
ObjectSet(dLine,OBJPROP_BACK,Show_Rectangles);
ObjectSet(dLine,OBJPROP_WIDTH,w);
ObjectSet(dLine,OBJPROP_STYLE,s);
}
void DeleteCreate_DailyLineHI()
{
ObjectDelete( Curr_DG);ObjectDelete( Curr_WG);ObjectDelete( Curr_MG);
}
void CreateDHI()
{
DeleteCreate_DailyLineHI();
ObjectsDeleteAll(0,OBJ_RECTANGLE);
CreateWHI();
}
void Create_DailyLineWHI(string WLine, double start, double end,double w, double s,color clr)
{
ObjectCreate(WLine, OBJ_RECTANGLE, 0, iTime(NULL,10080,0), start, Time[0], end);
ObjectSet(WLine, OBJPROP_COLOR, clr);
ObjectSet(WLine,OBJPROP_RAY,false);
ObjectSet(WLine,OBJPROP_BACK,Show_Rectangles);
ObjectSet(WLine,OBJPROP_WIDTH,w);
ObjectSet(WLine,OBJPROP_STYLE,s);
}
void DeleteCreate_DailyLineWHI()
{
ObjectDelete( Curr_WG);
}
void CreateWHI()
{
DeleteCreate_DailyLineWHI();
ObjectsDeleteAll(0,OBJ_RECTANGLE);
CreateMHI();
}
void Create_DailyLineMHI(string MLine, double start, double end,double w, double s,color clr)
{
ObjectCreate(MLine, OBJ_RECTANGLE, 0, iTime(NULL,43200,0), start, Time[0], end);
ObjectSet(MLine, OBJPROP_COLOR, clr);
ObjectSet(MLine,OBJPROP_RAY,false);
ObjectSet(MLine,OBJPROP_BACK,Show_Rectangles);
ObjectSet(MLine,OBJPROP_WIDTH,w);
ObjectSet(MLine,OBJPROP_STYLE,s);
}
void DeleteCreate_DailyLineMHI()
{
ObjectDelete( Curr_MG);
}
void CreateMHI()
{
DeleteCreate_DailyLineMHI();
ObjectsDeleteAll(0,OBJ_RECTANGLE);
double Dailyhigh = iHigh(NULL,1440,0);
double Dailylow = iLow(NULL,1440,0);
double Weeklyhigh = iClose(NULL,10080,0);
double Weeklylow = iOpen(NULL,10080,0);
double Monthlyhigh = iOpen(NULL,43200,0);
double Monthlylow = iLow(NULL,43200,0);
if ( Rectangle_Curr_DayPeriod_only == false )
{
if (Show_CurrRectangles_Display == true )
{
if (Show_Daily_Rectangle == true )
{
Create_DailyLineHI( Curr_DG, Dailyhigh , Dailylow ,2,2,Daily_Rectangle_color);
}
if (Show_Weekly_Rectangle == true )
{
Create_DailyLineWHI( Curr_WG, Weeklyhigh , Weeklylow ,2,2,Weekly_Rectangle_color);
}
if (Show_Monthly_Rectangle == true )
{
Create_DailyLineMHI( Curr_MG, Monthlyhigh , Monthlylow ,2,2,Monthly_Rectangle_color);
}}}
if ( Rectangle_Curr_DayPeriod_only == true )
{
if (Show_CurrRectangles_Display == true )
{
if (Show_Daily_Rectangle == true )
{
Create_DailyLineHI( Curr_DG, Dailyhigh , Dailylow ,2,2,Daily_Rectangle_color);
}
if (Show_Weekly_Rectangle == true )
{
Create_DailyLineHI( Curr_WG, Weeklyhigh , Weeklylow ,2,2,Weekly_Rectangle_color);
}
if (Show_Monthly_Rectangle == true )
{
Create_DailyLineHI( Curr_MG, Monthlyhigh , Monthlylow ,2,2,Monthly_Rectangle_color);
}}}
//*******************************************************************************
int i;
ObjDel();
num=0;
for (shift=CountDays-1;shift>=0;shift--)
{
time1=iTime(NULL,PERIOD_D1,shift);
time3=iTime(NULL,PERIOD_W1,shift);
time5=iTime(NULL,PERIOD_MN1,shift);
//**************************************************
//CurrDaily levels
time7=iTime(NULL,PERIOD_D1,0);
time9=iTime(NULL,PERIOD_W1,0);
time11=iTime(NULL,PERIOD_MN1,0);
//**********************************************
//Pivot
time13=iTime(NULL,PERIOD_D1,shift);
time15=iTime(NULL,PERIOD_W1,shift);
time17=iTime(NULL,PERIOD_MN1,shift);
i=shift-1;
if (i<0)
time2=Time[0];
else
time2=iTime(NULL,PERIOD_D1,i)-Period()*60;
if (i<0)
time4=Time[0];
else
time4=iTime(NULL,PERIOD_W1,i)-Period()*60;
if (i<0)
time6=Time[0];
else
time6=iTime(NULL,PERIOD_MN1,i)-Period()*60;
if (i<0)
//***********************************************************
//CurrDaily levels
time8=iTime(NULL,PERIOD_D1,0)-Period()*60;
time10=iTime(NULL,PERIOD_W1,0)-Period()*60;
time12=iTime(NULL,PERIOD_MN1,0)-Period()*60;
//*********************************************************
//Pivot
if (i<0)
time14=Time[0];
else
time14=iTime(NULL,PERIOD_D1,i)-Period()*60;
if (i<0)
time16=Time[0];
else
time16=iTime(NULL,PERIOD_W1,i)-Period()*60;
if (i<0)
time18=Time[0];
else
time18=iTime(NULL,PERIOD_MN1,i)-Period()*60;
highD = iHigh(NULL,PERIOD_D1,shift+1);
lowD = iLow(NULL,PERIOD_D1,shift+1);
closeD = iClose(NULL,PERIOD_D1,shift+1);
highW = iOpen(NULL,PERIOD_W1,shift+1);
lowW = iOpen(NULL,PERIOD_W1,shift+1);
closeW = iOpen(NULL,PERIOD_W1,shift+1);
highM = iOpen(NULL,PERIOD_MN1,shift+1);
lowM = iLow(NULL,PERIOD_MN1,shift+1);
closeM = iClose(NULL,PERIOD_MN1,shift+1);
PD = (highD+lowD+closeD)/3.0;
PW = (highW+lowW+closeW)/3.0;
PM = (highM+lowM+closeM)/3.0;
DHi = iHigh(NULL,PERIOD_D1,shift+1);
DLo = iLow(NULL,PERIOD_D1,shift+1);
WHi = iOpen(NULL,PERIOD_W1,shift+0);
WHi_TP_L = WHi+TP_Target*Point;
WHi_TP_S = WHi-TP_Target*Point;
WLo = iOpen(NULL,PERIOD_W1,shift+1);
MHi = iHigh(NULL,PERIOD_MN1,shift+1);
MLo = iLow(NULL,PERIOD_MN1,shift+1);
//***************************
//CurrDaily levels
DHigh = iHigh(NULL,PERIOD_D1,0);
DLow = iLow(NULL,PERIOD_D1,0);
WHigh = iClose(NULL,PERIOD_W1,0);
WLow = iOpen(NULL,PERIOD_W1,0);
MHigh = iHigh(NULL,PERIOD_MN1,0);
MLow = iLow(NULL,PERIOD_MN1,0);
time2=time1+PERIOD_D1*60;
time4=time3+PERIOD_W1*60;
time6=time5+PERIOD_MN1*60;
//******************************************
// CurrDaily levels
time8=time7+PERIOD_D1*60;
time10=time9+PERIOD_W1*60;
time12=time11+PERIOD_MN1*60;
//******************************************
//Pivot
time14=time13+PERIOD_D1*60;
time16=time15+PERIOD_W1*60;
time18=time17+PERIOD_MN1*60;
num=shift;
if (Show_PreviousDaily == true)
{
PlotLineD("Previous_DailyHi["+num+"]",DHi,Magenta,0);
PlotLineD("Previous_DailyLo["+num+"]",DLo,line_color_PreviousDaily,0);
}
if (Show_PreviousWeekly == true)
{
PlotLineWL("PW_TP_Long["+num+"]",WHi_TP_L,TP_Long_Target,0);
PlotLineW("Previous_WeeklyHi["+num+"]",WHi,Weekly_Open,0);
PlotLineWS("PW_TP_Short["+num+"]",WHi_TP_S,TP_Short_Target,0);
//PlotLineW("Previous_WeeklyLo["+num+"]",WLo,line_color_PerviousWeekLow,0);
}
if (Show_PreviousMonthly == true)
{
//PlotLineM("Previous_MonthlyHi["+num+"]",MHi,line_color_PreviousMonthly,0);
//PlotLineM("Previous_MonthlyLo["+num+"]",MLo,line_color_PreviousMonthly,0);
}
//***************************************************************************************************
//CurrDaily levels
if (Show_CurrDaily == true)
{
PlotLineDLY("CurrentDailyHi["+num+"]",DHigh,line_color_CurrDailyUPPER ,0);
PlotLineDLY("CurrentDailyLo["+num+"]",DLow,line_color_CurrDailyLOWER,0);
}
if (Show_CurrWeekly == true)
{
// PlotLineWLY("CurrentWeeklyHi["+num+"]",WHigh,line_color_CurrWeeklyUPPER,0);
// PlotLineWLY("CurrentWeeklyLo["+num+"]",WLow,line_color_CurrWeeklyLOWER,0);
}
if (Show_CurrMonthly == true)
{
PlotLineMLY("CurrentMonthlyHi["+num+"]",MHigh,line_color_CurrMonthlyUPPER ,0);
PlotLineMLY("CurrentMonthlyLo["+num+"]",MLow,line_color_CurrMonthyLOWER,0);
}}
//*****************************************
if (Show_Daily_Pivots == true)
{
PlotLinePVT("CurrentPivot["+num+"]",PD,Daily_Pivot_color,0);
}
if (Show_Weekly_Pivots == true)
{
PlotLinePVTW("CurrentWeeklylyPivot["+num+"]",PW,Weekly_Pivot_color,0);
}
if (Show_Monthly_Pivots == true)
{
PlotLinePVTM("CurrentMonthlyPivot["+num+"]",PM,Monthly_Pivot_color ,0);
}
if (Show_LABELS == true)
{
// if(ObjectFind("HILO") != 0){
// ObjectCreate("HILO", OBJ_TEXT, 0, Time[Shift_CurrDaily_LABEL], DHigh);
// ObjectSetText("HILO", " Daily High "+DoubleToStr(DHigh,Digits)+"", 8, "Arial", line_color_CurrDailyUPPER);
// }else{ ObjectMove("HILO", 0, Time[Shift_CurrDaily_LABEL], DHigh);}
// if(ObjectFind("HILO1") != 0){
// ObjectCreate("HILO1", OBJ_TEXT, 0, Time[Shift_CurrDaily_LABEL], DLow);
// ObjectSetText("HILO1", " Daily Low "+DoubleToStr(DLow,Digits)+" ", 8, "Arial", line_color_CurrDailyLOWER);
// }else{ ObjectMove("HILO1", 0, Time[Shift_CurrDaily_LABEL], DLow);}
/* if(ObjectFind("HILO2") != 0){
ObjectCreate("HILO2", OBJ_TEXT, 0, Time[Shift_CurrWeekly_LABEL], WHigh);
ObjectSetText("HILO2", " "+DoubleToStr(WHigh,Digits)+" ", 8, "Arial", line_color_CurrWeeklyUPPER);//Weekly HighWeekly
}else{ ObjectMove("HILO2", 0, Time[Shift_CurrWeekly_LABEL], WHigh);}
if(ObjectFind("HILO3") != 0){
ObjectCreate("HILO3", OBJ_TEXT, 0, Time[Shift_CurrWeekly_LABEL], WLow);
ObjectSetText("HILO3", " "+DoubleToStr(WLow,Digits)+" ", 8, "Arial", line_color_CurrWeeklyLOWER);// Weekly Low
}else{ ObjectMove("HILO3", 0, Time[Shift_CurrWeekly_LABEL], WLow);}
*/
// if(ObjectFind("HILO4") != 0){
//ObjectCreate("HILO4", OBJ_TEXT, 0, Time[Shift_CurrMonthly_LABEL], MHigh);
//ObjectSetText("HILO4", " Monthly High "+DoubleToStr(MHigh,Digits)+" ", 8, "Arial", line_color_CurrMonthlyUPPER);
// }else{ ObjectMove("HILO4", 0, Time[Shift_CurrMonthly_LABEL], MHigh);}
// if(ObjectFind("HILO5") != 0){
//ObjectCreate("HILO5", OBJ_TEXT, 0, Time[Shift_CurrMonthly_LABEL], MLow);
//ObjectSetText("HILO5", " Monthly Low "+DoubleToStr(MLow,Digits)+" ", 8, "Arial", line_color_CurrMonthyLOWER);
// }else{ ObjectMove("HILO5", 0, Time[Shift_CurrMonthly_LABEL], MLow);}
//Previous Levels
// if(ObjectFind("HILOP") != 0){
//ObjectCreate("HILOP", OBJ_TEXT, 0, Time[Shift_Prev_LABEL+10], DHi);
// ObjectSetText("HILOP", "Prev / Daily High "+DoubleToStr(DHi,Digits)+" ", 8, "Arial", line_color_PreviousDaily);
//}else{ ObjectMove("HILOP", 0, Time[Shift_Prev_LABEL+10], DHi);}
if(ObjectFind("HILO1P") != 0)
{
ObjectCreate("HILO1P", OBJ_TEXT, 0, Time[Shift_Prev_LABEL+10], WHi_TP_L);
ObjectSetText("HILO1P", " "+DoubleToStr(WHi_TP_L,Digits)+" ", Label_Size, "Arial", TP_Long_Target);
}
else
{
ObjectMove("HILO1P", 0, Time[Shift_Prev_LABEL+10], WHi_TP_L);
}
if(ObjectFind("HILO2P") != 0)
{
ObjectCreate("HILO2P", OBJ_TEXT, 0, Time[Shift_Prev_LABEL+10], WHi);
ObjectSetText("HILO2P", " "+DoubleToStr(WHi,Digits)+" ", Label_Size, "Arial", Weekly_Open);// Prev - Weekly High
}
else
{
ObjectMove("HILO2P", 0, Time[Shift_Prev_LABEL+10], WHi);
}
if(ObjectFind("HILO3P") != 0)
{
ObjectCreate("HILO3P", OBJ_TEXT, 0, Time[Shift_Prev_LABEL+10], WHi_TP_S);
ObjectSetText("HILO3P", " "+DoubleToStr(WHi_TP_S,Digits)+" ", Label_Size, "Arial", TP_Short_Target);// Prev - Weekly Low
}
else
{
ObjectMove("HILO3P", 0, Time[Shift_Prev_LABEL+10], WHi_TP_S);
}
// if(ObjectFind("HILO4P") != 0){
// ObjectCreate("HILO4P", OBJ_TEXT, 0, Time[Shift_Prev_LABEL+10], MHi);
//ObjectSetText("HILO4P", "Prev / Monthly High "+DoubleToStr(MHi,Digits)+" ", 8, "Arial", line_color_PreviousMonthly);
// }else{ ObjectMove("HILO4P", 0, Time[Shift_Prev_LABEL+10], MHi);}
// if(ObjectFind("HILO5P") != 0){
//ObjectCreate("HILO5P", OBJ_TEXT, 0, Time[Shift_Prev_LABEL+10], MLo);
//ObjectSetText("HILO5P", "Prev / Monthly Low"+DoubleToStr(MLo,Digits)+" ", 8, "Arial", line_color_PreviousMonthly);
//}else{ ObjectMove("HILO5P", 0, Time[Shift_Prev_LABEL+10], MLo);}
// if (Show_Daily_Pivots == true)
// {
// if(ObjectFind("PIVOTD") != 0){
// ObjectCreate("PIVOTD", OBJ_TEXT, 0, Time[ShiftPivot_LABELS+0], PD);
// ObjectSetText("PIVOTD", "D / Pivot "+DoubleToStr(PD,Digits)+" ", 8, "Arial", Daily_Pivot_color);
// }else{ ObjectMove("PIVOTD", 0, Time[ShiftPivot_LABELS+0], PD);}
// }
// if (Show_Weekly_Pivots == true)
// {
// if(ObjectFind("PIVOTW") != 0){
// ObjectCreate("PIVOTW", OBJ_TEXT, 0, Time[ShiftPivot_LABELS+0], PW);
// ObjectSetText("PIVOTW", "W / Pivot "+DoubleToStr(PW,Digits)+" ", 8, "Arial", Weekly_Pivot_color);
// }else{ ObjectMove("PIVOTW", 0, Time[ShiftPivot_LABELS+0], PW);}
// }
// if (Show_Monthly_Pivots == true)
//{
// if(ObjectFind("PIVOTM") != 0){
// ObjectCreate("PIVOTM", OBJ_TEXT, 0, Time[ShiftPivot_LABELS+0], PM);
//ObjectSetText("PIVOTM", "M / Pivot "+DoubleToStr(PM,Digits)+" ", 8, "Arial", Monthly_Pivot_color);
// }else{ ObjectMove("PIVOTM", 0, Time[ShiftPivot_LABELS+0], PM);}
//}
}
return(0);
}
//+------------------------------------------------------------------+
Comments