Changing The Chart with ChartSetInteger

 

Hey! I am trying to change features such as the color of candles and background color so they automatically load when the EA is placed on the chart, I'm not sure why this function won't load in the Mq4 file for the EA, so I'm trying to change the colors in a separate source file then #include it in the EA so the EA code can run after the Colors set, how can I do that??

At this moment it is loading the ChartRepaint.mq4 and successfully changing colors but the EA's code doesn't run, when i had the code inside the EA's Mq4 file, it was running the EA fine but not running the chart repaint code.

and for anyone wondering when the code was inside the EA in the OnInit(), it was indeed just the ChartSetInteger lines of code nothing more lol.


//+------------------------------------------------------------------+
//|                                                Chart Repaint.mq4 |
//|                                  Copyright 2024, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

int OnInit()
  {

        // Change Chart Features

   
   // Change To Candlesticks 
   ChartSetInteger(0,CHART_MODE,CHART_CANDLES);
   
   // Change Chart Background Color
   ChartSetInteger(0,CHART_COLOR_BACKGROUND,clrMidnightBlue);
   
   // Change Grid color to match
   ChartSetInteger(0,CHART_COLOR_GRID,clrMidnightBlue);
   
   // Change BULL Candles Color
   ChartSetInteger(0,CHART_COLOR_CANDLE_BULL,clrDodgerBlue);
   // Change UP (BULL BODY, WICK & SHADOW)
   ChartSetInteger(0,CHART_COLOR_CHART_UP,clrDodgerBlue);
   
   // Change Bear Candles Color
   ChartSetInteger(0,CHART_COLOR_CANDLE_BEAR,clrMediumOrchid);
   //Change Down (BEAR BODY, WICK & SHADOW);
   ChartSetInteger(0,CHART_COLOR_CHART_DOWN,clrMediumOrchid);

   
      
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+