Unresponsive Buttons

 

Hi Guys...

I'm just wondering if anyone has the same issue... my mql4 "Buttons" (OnChartEvent) on my MT4 charts are very delayed or un-responsive.... It's definitely got something to do with the Data Feed but I have no other way to explain this to you... You will either know what I am talking about or you won't... I'm hoping one of you guru's will...


When I "Click" a button... I'm never sure if I need to "Click" it again.... sometimes it's quick and there are no issues... but other times I need to wait... then either it turns ON or I'm not sure if I should click it again... Sorry for being so vague... but there is no other way to explain it...

 
Fix the code.
 
Marco vd Heijden:
Fix the code.

Where Marco... this is why I am asking...

 

It doesn't get much simpler than this... That's why I didn't post any code....

//+-----------------------------------+
//| GUI Trade Info Box                |
//+-----------------------------------+

//--- Rhythm Trading Button -------------------------------------------
   if(id == CHARTEVENT_OBJECT_CLICK
      && sparam == "Rhythm_TradingButton")
      {
      PlaySound("ok.wav");
         if(Allow_Live_Trading==false) 
            {
             Allow_Live_Trading = true; 
            }
         else 
            {
             Allow_Live_Trading = false;
            }
         Trading_Button();
      }
 
That's not all.
 

I'm trying to resolve something here... 

//+-----------------------------------------+
//| RESUME/STOP TRADING Button              |
//+-----------------------------------------+
void Trading_Button()
{

color TradingTextColor,
      TradingBackgroundColor,
      TradingBorderColor;
string TradingText;

if(Allow_Live_Trading==false) 
   {
    TradingTextColor = LightGray; 
    TradingBackgroundColor = C'0,45,0';
    TradingBorderColor = ButtonBorderColor;
    TradingText = "RESUME Live Trading";
   }
if(Allow_Live_Trading==true) 
   {
    TradingTextColor = LightGray; 
    TradingBackgroundColor = C'60,0,0';
    TradingBorderColor = ButtonBorderColor;
    TradingText = "STOP Live Trading";
   }

int chart_ID = 0;
string name = "Rhythm_TradingButton";
   
ObjectDelete(chart_ID,name);
   ObjectCreate(chart_ID,name,OBJ_BUTTON,0,0,0);
   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,CORNER_LEFT_UPPER);
   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,12*ChartCoeff);
   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,192*ChartCoeff);
   ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,205*ChartCoeff);
   ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,35*ChartCoeff);
   ObjectSetString(chart_ID,name,OBJPROP_TEXT,TradingText);
   ObjectSetString(chart_ID,name,OBJPROP_FONT,"Cambria");
   ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,Text15);
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,TradingTextColor);
   ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,TradingBackgroundColor);
   ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_COLOR,C'130,100,20');
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_STATE,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,true);
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,100);
}

 
MikeT:

Your snippet is incomplete. Post enough for someone to help you or expect to get answers like Marco's. Think of it from our point of view. Imagine you're trying to debug someone's code when they say, what's wrong with my code??!

{
  AGLOablVarIable = DO_SomeThing() ? SomeUndisclosedGlobalVariable : OtherFunc();
}
 
All the variables are Global Variables...
 
MikeT:
All the variables are Global Variables...

Besides that not being a good habit, you need to post everything within the scope of this function in order to receive help. Just post the entire file instead of incomplete snippets. 

 

All 30 000 lines...? Or just the few that are relevant as posted above..?

And, why are you guys moderating (deleting) my posts like this....I'm on a Forum asking for help/ideas...

I don't get it...??? What happened to the Thanx Nicoli post... what happened to the 2 prior w.t.f Marco posts... why do you think I even said w.t.f Marco....

 
I'm actually speechless... What happened to this forum... Has everyone gone to MQL5 by just being ******* (I should rather say *****) to us MQL4 guys....
Reason: