Hi Guys, I solved the first problem now it executes both the code of when the button "is pressed" and the code of when the button "is not pressed".
Now the problem is this one:
- when "I press the button" it shows some levels on the graph (I attach figure 2 "button clicked");
- I have the problem when "I press the button" and change TF, the button remains pressed but it deletes the levels ( I attach figure 1 "button clicked" to the TF change";
- how do I fix it to not delete the levels when changing TF? I also tried to delete the "OnDeinit" function but the problem remains the same.
I have done more than one indicator and I never had this problem, this is the first one where I use the button object and I have this problem doesn't depend on this?
I also did the test clicking with the "right button" - Object List : I press the button in h4 and in Object List: there are the created objects that are printed on the chart, if I change TF they disappear I don't really understand the problem, do you have any suggestions?
if(sparam=="OpenCloseDay") { if(PressedOpenCloseD1)//if(ObjectGetInteger(0,"OpenCloseSem",OBJPROP_STATE)==true) //Premuto { // ObjectSetInteger(0,"OpenCloseSem",OBJPROP_STATE,false); if(barre<Bars) { barre=Bars; show_open_D1=true; show_close_D1=true; drawAll(); } } else//non premuto { show_open_D1=false; show_close_D1=false; ObjectDelete(0,"open_D1_txt");ObjectDelete(0,"open_D1");ObjectDelete(0,"open_D1_txt"); ObjectDelete(0,"close_D1_txt");ObjectDelete(0,"close_D1");ObjectDelete(0,"close_D1_txt"); ObjectSetInteger(0,"MaxMinDay",OBJPROP_STATE,false); } PressedOpenCloseD1= !PressedOpenCloseD1; }
Files:
btn_cliccato.JPG
74 kb
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
This button panel is used to show various things on the chart, one of these is to mark the min and max monthly, now, if I click the button and change TF, the button "remains clicked" but the min/max monthly is deleted on the chart, how should I do to avoid the deletion?