//pipcounter #property indicator_chart_window extern string starttime="2011.01.01 00:00"; int init() { ObjectCreate("sumpips",OBJ_LABEL,0,0,0); ObjectSet("sumpips",OBJPROP_CORNER,3); ObjectSetText("sumpips","R",16); ObjectSet("sumpips",OBJPROP_COLOR,White); ObjectSet("sumpips",OBJPROP_XDISTANCE,50); ObjectSet("sumpips",OBJPROP_YDISTANCE,5); start(); return(0); } int deinit() { ObjectDelete("sumpips"); return(0); } int start() { double realized=calcRealized(); ObjectSetText("sumpips",sign(realized)+DoubleToStr(MathAbs(realized)/10,1)); return(0); } double calcRealized() { double profit=0; double p=0; for(int i=0;iStrToTime(starttime)) ) { p=0; if(OrderType()==OP_BUY) { p=(OrderClosePrice()-OrderOpenPrice())/Point; } if(OrderType()==OP_SELL) { p=(OrderOpenPrice()-OrderClosePrice())/Point; } profit+=p; } } } return(profit); } string sign(double value) { if(value>0) { return("+"); } if(value<0) { return("-"); } }