the sum of bars length - page 2

 
how can i connect sum+ to ObjectCreate ?

I see that you aren't familiar with the += operator. ;)

sum += ( iHigh( NULL, 0, i ) - iLow( NULL, 0, i ));

...is exactly the same as:

sum = sum + ( iHigh( NULL, 0, i ) - iLow( NULL, 0, i ));

It really just saves on typing and makes code more readable.

You have the similar operators for subtraction, division, and multiplication: -=, /=, and *= respectively.

Correcting your ObjectCreate bit is easy:

ObjectCreate( "Diff", OBJ_LABEL, 0, 0, 0 );

      ObjectSetText( "Diff", DoubleToStr( sum, 5 ), 14, "Arial", Red );
      ObjectSet( "Diff", OBJPROP_XDISTANCE, 20 );
      ObjectSet( "Diff", OBJPROP_YDISTANCE, 42);
      ObjectSet( "Diff", OBJPROP_CORNER, 3 );

	          
 
Anomalous:

I see that you aren't familiar with the += operator. ;)

............

.......





hi.......thanks for ur help my friend.......am really new to mql4 at all.....and tray to learn as much as i can,

i must say thanks again for ur help .....i appreciate

Reason: