Sweet pip, Here is some mt4 code for the lines, in case you wanted to have them populated automatically on the chart.
//+---------------------------------------------------------+
//| Husky_1_Daily_data_ |
//| Authored by Husky_1 |
//| Drawline credits below |
//| V1.1 - adds weekly open and last 4 weeks high/lows |
//+---------------------------------------------------------+
#property indicator_chart_window
//---- Lets define our colors
extern color TodayLineColor=Aqua;
extern color WeeklyOpenLineColor=HotPink;
extern color YesterdayLineColor=Gray;
extern color LastWeekLineColor=Gray;
extern color ThisWeekLineColor=Gray;
extern color ThisWeekOpenLineColor=Aqua;
extern color MnthLineColor =Gray;
extern color MnCloseColor =Gray;
//---Lets start
void start()
{
string thisyear=Year();
string thismonth=Month();
string thisday=Day();
string timeframe= StringConcatenate(thisyear,".",thismonth,".",thisday," 02:00");
datetime todayinfo = StrToTime(timeframe);
//
//Print (timeframe);
double eudo=iOpen(NULL,PERIOD_M1,iBarShift(NULL,PERIOD_M1,todayinfo,false));
double eumc=iClose(NULL,PERIOD_M1,iBarShift(NULL,PERIOD_M1,todayinfo,false));
double euhc=iClose(NULL,PERIOD_H1,iBarShift(NULL,PERIOD_H1,todayinfo,false));
//---- Send to console
//Print (Symbol(), " Intialopen:",eudo," 1st Minute Close:",eumc," 1st Hour Close:",euhc);
//---- Draw Lines
{
// DrawLine(eudo,"Intialopen",DailyLineColor);
// DrawLine(euhc,"Hourclose",LineColor);
//DrawLine(eumc,"MinutClose",LineColor);
DrawLine(iClose(NULL,PERIOD_D1, 1),"Yesterday Close", YesterdayLineColor);
DrawLine(iHigh(NULL,PERIOD_D1, 1),"Yesterday High", YesterdayLineColor);
DrawLine(iLow(NULL,PERIOD_D1, 1),"Yesterday Low", YesterdayLineColor);
DrawLine(iOpen(NULL,PERIOD_D1, 0),"Todays Open", TodayLineColor);
DrawLine(iHigh(NULL,PERIOD_D1, 0),"Todays High", TodayLineColor);
DrawLine(iLow(NULL,PERIOD_D1, 0),"Todays Low", TodayLineColor);
DrawLine(iLow(NULL,PERIOD_MN1, 1),"Last Month Low", MnthLineColor);
DrawLine(iHigh(NULL,PERIOD_MN1, 1),"Last Month High", MnthLineColor);
DrawLine(iOpen(NULL,PERIOD_MN1, 1),"Last Month Open", MnthLineColor);
DrawLine(iOpen(NULL,PERIOD_W1, 0),"Weekly Open", WeeklyOpenLineColor);
DrawLine(iOpen(NULL,PERIOD_W1, 1),"Last Weeks Open", LastWeekLineColor);
DrawLine(iLow(NULL,PERIOD_W1, 1),"Last Week Low", LastWeekLineColor);
DrawLine(iHigh(NULL,PERIOD_W1, 1),"Last Week High", LastWeekLineColor);
DrawLine(iLow(NULL,PERIOD_W1, 2),"2 Weeks Ago Low", LastWeekLineColor);
DrawLine(iHigh(NULL,PERIOD_W1, 2),"2 Weeks Ago High", LastWeekLineColor);
DrawLine(iOpen(NULL,PERIOD_W1, 2),"2 Weeks Ago Open", LastWeekLineColor);
DrawLine(iLow(NULL,PERIOD_W1, 3),"3 Weeks Ago Low", LastWeekLineColor);
DrawLine(iHigh(NULL,PERIOD_W1, 3),"3 Weeks Ago High", LastWeekLineColor);
DrawLine(iOpen(NULL,PERIOD_W1, 3),"3 Weeks Ago Open", LastWeekLineColor);
DrawLine(iLow(NULL,PERIOD_W1, 4),"4 Weeks Ago Low", LastWeekLineColor);
DrawLine(iHigh(NULL,PERIOD_W1, 4),"4 Weeks Ago High", LastWeekLineColor);
DrawLine(iOpen(NULL,PERIOD_W1, 4),"4 Weeks Ago Open", LastWeekLineColor);
}
//---- End Draw Lines
return(0);
}
//+------------------------------------------------+
//|Drawline code re-used from: |
//| DOSR.mq4 |
//| Developed by mqldev |
//| http://www.mqldev.com| |
//+------------------------------------------------+
int DrawLine(double price , string Obj , color clr)
{
int objs=ObjectsTotal();
string name;
for(int cnt=ObjectsTotal()-1;cnt>=0;cnt--)
{
name=ObjectName(cnt);
if (StringFind(name,Obj,0)>-1)
{
ObjectMove(Obj,0,Time[0],price);
ObjectsRedraw();
return(1);
}
}
ObjectCreate(Obj,OBJ_HLINE,0,5,price);
ObjectSet(Obj,OBJPROP_COLOR,clr);
ObjectSetText(Obj, Obj);
ObjectSet(Obj,OBJPROP_STYLE,STYLE_DOT);
WindowRedraw();
return(0);
}
int deinit()
{
//----
ObjectDelete( "Initial open");
ObjectDelete( "Todays Open");
ObjectDelete( "Todays High");
ObjectDelete( "Todays Low");
ObjectDelete( "Yesterday High");
ObjectDelete( "Yesterday Low");
ObjectDelete( "Yesterday Close");
ObjectDelete( "Last Week Low");
ObjectDelete( "Last Week High");
ObjectDelete( "This Week Open");
ObjectDelete( "Last Month Low");
ObjectDelete( "Last Month High");
ObjectDelete( "Weekly Open" );
ObjectDelete( "Last Weeks Open" );
ObjectDelete( "2 Weeks Ago Low" );
ObjectDelete( "2 Weeks Ago High" );
ObjectDelete( "2 Weeks Ago Open" );
ObjectDelete( "3 Weeks Ago Low" );
ObjectDelete( "3 Weeks Ago High" );
ObjectDelete( "3 Weeks Ago Open" );
ObjectDelete( "4 Weeks Ago Low" );
ObjectDelete( "4 Weeks Ago High" );
ObjectDelete( "4 Weeks Ago Open" );
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+