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 |//+------------------------------------------------------------------+intOnInit()
{
// Change Chart Features// Change To Candlesticks ChartSetInteger(0,CHART_MODE,CHART_CANDLES);
// Change Chart Background ColorChartSetInteger(0,CHART_COLOR_BACKGROUND,clrMidnightBlue);
// Change Grid color to matchChartSetInteger(0,CHART_COLOR_GRID,clrMidnightBlue);
// Change BULL Candles ColorChartSetInteger(0,CHART_COLOR_CANDLE_BULL,clrDodgerBlue);
// Change UP (BULL BODY, WICK & SHADOW)ChartSetInteger(0,CHART_COLOR_CHART_UP,clrDodgerBlue);
// Change Bear Candles ColorChartSetInteger(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 |//+------------------------------------------------------------------+voidOnDeinit(constint reason)
{
//---
}
//+------------------------------------------------------------------+//| Expert tick function |//+------------------------------------------------------------------+voidOnTick()
{
//---
}
//+------------------------------------------------------------------+
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.