color Hline doesn't change, also invisible using iHigh/iLow

 
Hey All



I was watching multiple tutorials on youtube about creating lines (objects and stuff). The problem now is i cant change the color in my last EA practice script.

The lines stays red and i had this problem last week for the first time with another tutorial. First i thougt i did something wrong.

but it turns out there is someting with my MT5.

i ll show you the very simple code. When i change the color to green, purple or what ever, it shows red in the chart and stategy tester.

i use Copy High cause when i use iHigh line will be invisible


Someone idea how to fix this ?



code below


#property copyright "Copyright 2024, MetaQuotes Ltd."

#property link      "https://www.mql5.com"

#property version   "1.00"

//+------------------------------------------------------------------+

//| Expert initialization function                                   |

//+------------------------------------------------------------------+



//+------------------------------------------------------------------+

//| Inputs                                                           |

//+------------------------------------------------------------------+

input double Lotsize = 0.1;

input int Stoploss = 150;

input int Takeprofit = 100;



input int Aantal_bars_count = 100;

input color highcolor = clrAliceBlue;



int OnInit()

  {



   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| Expert deinitialization function                                 |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {



   

  }

//+------------------------------------------------------------------+

//| Expert tick function                                             |

//+------------------------------------------------------------------+

void OnTick()

  {

int highestCandle; 

double high[];

   

   ArraySetAsSeries(high,true);

   CopyHigh(_Symbol,PERIOD_CURRENT,0,100,high);

   

  

   

   highestCandle= ArrayMaximum(high,0,100);

   

   MqlRates Priceinformation[];

   ArraySetAsSeries(Priceinformation,true);

   

   int Data=CopyRates(_Symbol,PERIOD_CURRENT,0,100,Priceinformation);

   

   ObjectCreate(NULL,"High",OBJ_HLINE,0,0,Priceinformation[highestCandle].high);

   ObjectGetInteger(NULL,"Highline",OBJPROP_COLOR,clrBlue);

   ObjectGetInteger(NULL,"High line",OBJPROP_WIDTH,2);

   ObjectMove(NULL,"High line",0,0,Priceinformation[highestCandle].high);

   

  }

//+------------------------------------------------------------------+

 
muntje:
ObjectGetInteger

ObjectSetInteger

 
Yashar Seyyedin #:

ObjectSetInteger

Thanks! Thats fixed this problem! But when i use OBJ_TREND it dissapears again 🤦‍♂️🤦‍♂️