Color that changes!

 

I have a script that draws some trend lines on a chart. It uses the same piece of code to draw each of the trend lines as follows:

    ObjectCreate(0,"ABCL"+eNextNode, OBJ_TREND, 0, dtNodeTime[eNextNode -1], dNodePrice[eNextNode -1] , dtNodeTime[eNextNode], dNodePrice[eNextNode]);
   ObjectSetInteger(0,"ABCL"+eNextNode,OBJPROP_COLOR,cWaveLine);

 The code works fine the issues is the first line that it creates changes color on the chart if you close the terminal and reopen it....

 Now bear in mind this is a script that created the objects so it won't be running when you restart.

 

The color that it changes to is clrGoldenRod which is what I had the lines set to originally, but have sine changed the value of cWaveLine to clrDeepSkyBlue.

If I select and check the object the colour is set correct to DeepSkyblue but appears as GoldenRod on the chart. 

For completeness I also deleted all objects from the chart and started again but the same thing happens.

So it seems that somehow MT5 has remembered the original setting for a single object that has been deleted and recreated since, and applies that memory on restart.

 How can I solve this annoying issue please?

thanks

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
 

solved  

 

 

 
MaxTrader 2012.07.03 08:18 

I have a script that draws some trend lines on a chart. It uses the same piece of code to draw each of the trend lines as follows:

   ObjectCreate(0,"ABCL"+eNextNode, OBJ_TREND, 0, dtNodeTime[eNextNode -1], dNodePrice[eNextNode -1] , dtNodeTime[eNextNode], dNodePrice[eNextNode]);
   ObjectSetInteger(0,"ABCL"+eNextNode,OBJPROP_COLOR,cWaveLine);

 The code works fine the issues is the first line that it creates changes color on the chart if you close the terminal and reopen it....

 Now bear in mind this is a script that created the objects so it won't be running when you restart.

The color that it changes to is clrGoldenRod which is what I had the lines set to originally, but have sine changed the value of cWaveLine to clrDeepSkyBlue.

If I select and check the object the colour is set correct to DeepSkyblue but appears as GoldenRod on the chart. 

For completeness I also deleted all objects from the chart and started again but the same thing happens.

So it seems that somehow MT5 has remembered the original setting for a single object that has been deleted and recreated since, and applies that memory on restart.

 How can I solve this annoying issue please?

thanks

MaxTrader 2012.07.03 09:33 

solved  


Hi MaxTrader,

1 hour 15 minutes, but how ?

Congrats though. 

:D 

 
onewithzachy:


Hi MaxTrader,

1 hour 15 minutes, but how ?

Congrats though. 

:D 

Simple enough really, my script was also creating a fib retracement between the same two points and I completely forgot that a fib retracement also puts the trend line in, and this with its defaul colours was laying ontop of the line object I had created.

 

looked very confusing but actually a simple issue

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
Reason: