Trying to change color of Blue Trendline in Strategy Tester output to Aqua.

 

Hi there

This is my 1st time on this Forum.
I have a problem with changing the colors of the Trendline in the Strategy Tester output.
The Trendline colors are Red and Blue.
I'm trying to change the blue to Aqua as I'm blind to Blue.

This script works but changes ALL the lines to Aqua.
I'm trying to only select the Blue and change it to Aqua.
The lines in the boxes are my attempts to exclude the Red or includethe Blue but it does not work.
This program currently compiles without any errors and changes ALL the Red and Blue lines to Aqua
provided  my 2 attempts in the boxes are hashed out.
Please help.
cheers
CJ

//+------------------------------------------------------------------+
//|                                                      myPrint.mq4 |
//|                         |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
 

   for( int n=ObjectsTotal()-1; n>=0; n-- ){
      string str= ObjectName(n);

      if( ObjectType(str) != OBJ_TREND )
         continue;
         
       ////////////////////////////////////////////////////////////////////
       //          *****trying to exclude Red***** OR
       //
       //       if( ObjectGet("Trendline", OBJPROP_COLOR)  != clrRed  )
       //       continue;
       /////////////////////////////////////////////////////////////////////////
       //         *****trying to include only Blue*****
       //
       //       if( ObjectGet("Trendline", OBJPROP_COLOR)  == clrBlue  )
       //      continue;
       //  
       //////////////////////////////////////////////////////////////////////////  
       

      if( StringGetChar(str,0) != '#' )
         continue;

      ObjectSet(str,OBJPROP_COLOR,Aqua);
   }
   
 
}

//+------------------------------------------------------------------+
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
 
Attached mq4 file
Files:
myPrint.mq4  2 kb
 
freefreecj #: Attached mq4 file

Try this:

void OnStart()
{
   for( int n=ObjectsTotal()-1; n>=0; n-- ){
      string str= ObjectName(n);

      if( ObjectType(str) != OBJ_TREND )
         continue;
      if( StringGetChar(str,0) != '#' )
         continue;
      if(ObjectGet(str,OBJPROP_COLOR)==Blue)
         ObjectSet(str,OBJPROP_COLOR,Aqua);
   }
} 
Improperly formatted code edited by moderator.
 
@Wen #: Try this:

Please don't wake up an old thread unnecessarily and use the CODE button (Alt-S) when inserting code.

Code button in editor