Download MetaTrader 5

Button ChartRedraw() delay

To add comments, please log in or register
rod178
272
rod178  


I am endeavoring to have a button redraw, for about one second, to give the appearance of the button being pressed and immediately unpressed, on a single click.
The below code does not delay the change of STATE by one second between true and false. I have also tried a loop delay, instead of Sleep(1000), to no avail.

Any suggestions?

 ObjectSetInteger(0,sparam,OBJPROP_STATE,true); 
 ChartRedraw();
 Sleep(1000); 
 ObjectSetInteger(0,sparam,OBJPROP_STATE,false); 
 ChartRedraw();



Keith Watford
Moderator
10568
Keith Watford  
rod178:


I am endeavoring to have a button redraw, for about one second, to give the appearance of the button being pressed and immediately unpressed, on a single click.
The below code does not delay the change of STATE by one second between true and false. I have also tried a loop delay, instead of Sleep(1000), to no avail.

Any suggestions?




If it is in an indicator, sleep will have no effect
To add comments, please log in or register