Hi! I have the following code and it works fine in GMT 0 broker, but I would like to change it to work for any broker.

Ex.: In ODL and IBFX, it shows Uptrend in EURUSD, but in FXPro, FXDD or any other broker which the time zone isn't GMT 0 - it shows DownTrend(wrong), I know it is because the code is using the wrong daily bar in the others brokers, but I don't know how I can change it, please help me, thanks in advance!

extern bool Commentt = TRUE;
extern int a = 1;
int GMTshift=0; //it is here, but it is not using in the code
int g_timeframe_116 = PERIOD_D1;
double gd_120;
double gd_128;
double gd_136;
double gd_144;
double gd_152;
double gd_160;
double gd_168;
double gd_176;
double gd_184;
double gd_200;

int start()
{
//----
int l_shift_4;
int li_8 = IndicatorCounted();
if (li_8 < 0) return (-1);
if (li_8 > 0) li_8--;
int li_12 = Bars - li_8;

for (int li_0 = li_12 - 1; li_0 >= 0; li_0--)
{
l_shift_4 = iBarShift(Symbol(), g_timeframe_116, Time[li_0], FALSE);
gd_176 = iHigh(Symbol(), g_timeframe_116, l_shift_4) + iLow(Symbol(), g_timeframe_116, l_shift_4 + a);
gd_120 = (iHigh(Symbol(), g_timeframe_116, l_shift_4 + a) + iLow(Symbol(), g_timeframe_116, l_shift_4 + a) + iClose(Symbol(), g_timeframe_116, l_shift_4 + a)) / 3.0;
gd_200 = iHigh(Symbol(), g_timeframe_116, l_shift_4 + a) - iLow(Symbol(), g_timeframe_116, l_shift_4 + a);
gd_128 = gd_176 / 2.0;

if (iClose(Symbol(), g_timeframe_116, l_shift_4 + a) > gd_120) gd_152 = gd_128 + gd_200;
if (iClose(Symbol(), g_timeframe_116, l_shift_4 + a) < gd_120) gd_152 = gd_128 - gd_200;
if (Commentt)
{
if (iClose(Symbol(), g_timeframe_116, l_shift_4 + a) > gd_120) Comment("TREND <<<<< UP >>>>> ENTRY <<<<<<<< [[BUY LEVEL AT]] >>>> ", gd_120, " <<<< [[TARGET]] >>>> ", gd_152,", <<<< ");
if (iClose(Symbol(), g_timeframe_116, l_shift_4 + a) < gd_120) Comment("TREND <<<<< DOWN >>>>> ENTRY <<<<<<<< [[SELL LEVEL AT]] >>>> ", gd_120, " <<<< [[TARGET]] >>>> ", gd_152,", <<<< ");
}
}
//----
return(0);
}