ObjectProp_Angle

 
double ang = ObjectGet("HighLine",OBJPROP_ANGLE);
   Print(ang);

Hi All,

I've drawn a line on a chart called "Highline" - does anybody know the point of the OBJPROP_ANGLE used in the context above?

it does not return the line angle!

thanks

 

(NB I have never used this property)

How did you draw "HighLine"? Is it a OBJ_TRENDBYANGLE? If you used 1 coordinate + ObjectSet() for Angle then your code should return angle

If you used 2 coordintates for a OBJ_TREND then I doubt that it will return an angle.

 
brewmanz:

(NB I have never used this property)

How did you draw "HighLine"? Is it a OBJ_TRENDBYANGLE? If you used 1 coordinate + ObjectSet() for Angle then your code should return angle

If you used 2 coordintates for a OBJ_TREND then I doubt that it will return an angle.


yes you're correct about zero angle return. I was messing around with drawing lines with the code below - but still don not know what OBJPROP_ANGLE does!

I guess I could work out the angles using normal trig.

extern int x,y;
int init()
  {
//---- indicators


   ObjectCreate("HighLIne",OBJ_TREND,0,Time[x],High[x],Time[y],High[y]);
   ObjectSet("HighLine", OBJPROP_WIDTH, 2);
   ObjectSet("HighLine", OBJPROP_COLOR, Yellow);
   ObjectSet("HighLine", OBJPROP_RAY,false);
   double ang = ObjectGet("HighLine",OBJPROP_ANGLE);
   Print(ang);
   ObjectCreate("LowLine",OBJ_TREND,0,Time[x],Low[x],Time[y],Low[y]);
   ObjectSet("LowLine", OBJPROP_WIDTH, 2);
   ObjectSet("LowLine", OBJPROP_COLOR, Yellow);
   ObjectSet("LowLine", OBJPROP_RAY,false); 
   //WindowRedraw();
   //ObjectCreate("Line1",OBJ_VLINE,0,TimeCurrent(),0,0);
   //ObjectSet("Line1", OBJPROP_TIME1,TimeCurrent());
   //ObjectSet("Line1", OBJPROP_WIDTH, 2);
   //ObjectSet("LIne1", OBJPROP_COLOR, Green);
   
             
//----
   return(0);
  }
 
This website uses cookies. Learn more about our Cookies Policy.