possible loss of data due to type conversion --WARNING

 

Hello, please help

Please give me some advice on what I should do about this...

      zcolor = ObjectGet("prev-LR-Trend",OBJPROP_COLOR);
      if(zcolor==clrDarkBlue){zBias=3;}
      else if (zcolor==clrDarkGreen){zBias=2;}      

...so, I'm creating an object ( a OBJ_STDDEVCHANNEL) over last weeks candles, calling it "prev-LR-Trend" and it is colored blue if sloping down and green if sloping up.  I want to check it's color and make the zBias correspond to later use it for drawing lines sloped up or down as necessary.

Should I concern myself with this warning?

Thank you

 
zcolor = ObjectGet("prev-LR-Trend",OBJPROP_COLOR);

It is best to get rid of the warnings although they may not really affect the execution.

ObjectGet() returns a double so you can try

color zcolor = (color)ObjectGet("prev-LR-Trend",OBJPROP_COLOR);
 
      zcolor = ObjectGet("prev-LR-Trend",OBJPROP_COLOR);

You didn't post what zcolor is. Always post all relevant code. There are no mind readers here and our crystal balls are cracked.
     How To Ask Questions The Smart Way. 2004
          Be precise and informative about your problem