const string h0="H0", h0S = "H0Str", h1="H1", h1S = "H1Str", l0="L0", l0S = "L0Str", l1="L1", l1S = "L1Str"; //+------------------------------------------------------------------+ int OnInit(){ myFct(h0, h0S, clrRed, "today High"); myFct(l0, l0S, clrRed, "today Low"); myFct(h1, h1S, clrGreen, "yesterday High"); myFct(l1, l1S, clrGreen, "yesterday Low"); return(INIT_SUCCEEDED); } void OnDeinit(const int reason){ ObjectDelete(h0); ObjectDelete(h1); ObjectDelete(l0); ObjectDelete(l1); ObjectDelete(h0S); ObjectDelete(h1S); ObjectDelete(l0S); ObjectDelete(l1S); } //+------------------------------------------------------------------+ int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[],const double &open[],const double &high[],const double &low[],const double &close[],const long &tick_volume[],const long &volume[],const int &spread[]){ double high0 = iHigh(_Symbol, PERIOD_D1, 0), high1 = iHigh(_Symbol, PERIOD_D1, 1), low0 = iLow(_Symbol, PERIOD_D1, 0) , low1 = iLow(_Symbol, PERIOD_D1, 1); datetime time0 = iTime(_Symbol, PERIOD_D1, 0), time1 = iTime(_Symbol, PERIOD_D1, 1), t = Time[0]; ObjectMove(0, h0, 0, time0, high0); ObjectMove(0, h1, 0, time1, high1); ObjectMove(0, l0, 0, time0, low0); ObjectMove(0, l1, 0, time1, low1); ObjectMove(0, h0S, 0, t, high0); ObjectMove(0, h1S, 0, t, high1); ObjectMove(0, l0S, 0, t, low0); ObjectMove(0, l1S, 0, t, low1); return(rates_total); } //+------------------------------------------------------------------+ void myFct(string name, string name2, color clr, string txt){ ObjectCreate(0, name, OBJ_HLINE, 0, 0, 0); ObjectSetInteger(0, name, OBJPROP_COLOR, 0, clr); ObjectCreate(0, name2, OBJ_TEXT, 0, 0, 0); ObjectSetText(name2, txt, 12, NULL, clr); ObjectSetInteger(0, name2, OBJPROP_ANCHOR, ANCHOR_CENTER); }