Thread: CCI Arrows
View Single Post
  #16 (permalink)  
Old 21st December 2009, 09:12
Default Avatar
fxwalb fxwalb is offline
Member
 
Join Date: Dec 2009
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Enivid View Post
I think that you can greatly reduce the indicator's load by placing this part of the code in the OnInit() function:

ObjectCreate(0, "myCCInow", OBJ_LABEL, 0, 0, 0);
ObjectSetString(0, "myCCInow", OBJPROP_FONT, font_face);
ObjectSetInteger(0, "myCCInow", OBJPROP_FONTSIZE, font_size);
ObjectSetInteger(0, "myCCInow", OBJPROP_COLOR, White);
ObjectSetInteger(0, "myCCInow", OBJPROP_CORNER, corner);
ObjectSetInteger(0, "myCCInow", OBJPROP_XDISTANCE, 1+distance_x);
ObjectSetInteger(0, "myCCInow", OBJPROP_YDISTANCE, 1+distance_y);

And this one leave in the OnCalculate():

ObjectSetString(0, "myCCInow", OBJPROP_TEXT,"CCI @ "+DoubleToString(myCCInow,1));

Yes, you are right, this is even better.
Thanks.
Reply With Quote