Page 21 of 366

Re: Indicators with ON/OFF buttons

Posted: Sat Jul 11, 2020 6:07 pm
by Banzai
!!!-MT4 X-XARDg-Heiken Ashi

from xard777.
With a touch of a button, you can turn on or off the Heiken Ashi indicator.

Re: Indicators with ON/OFF buttons

Posted: Sat Jul 11, 2020 8:58 pm
by marwilli
Banzai wrote: Sat Jul 11, 2020 3:20 pm


on or off button
very cool Banzai.
Thank you very much and happy weekend :-)

Re: Indicators with ON/OFF buttons

Posted: Sun Jul 12, 2020 12:59 am
by Lumios
Hey Banzai,

Having multiple buttons with the new code, make the previous button disappear. It seems they are all using the same button ID. What do you think? I tried to modify the "buttonid = id" but I got a compiling error. Maybe the button id can be set as an extern variable to keep them unique?

Edit: just tried to set the button id as an extern variable and that didnt work. It seems multiple buttons will conflict with each other.
Banzai wrote: Sat Jul 11, 2020 6:07 pm

Re: Indicators with ON/OFF buttons

Posted: Sun Jul 12, 2020 1:02 am
by BOLBAM
milad1987 wrote: Fri Jul 10, 2020 1:09 am

hello BOLBAM ; can you share your arrow indicator in your chart ?

Re: Indicators with ON/OFF buttons

Posted: Sun Jul 12, 2020 3:13 am
by Banzai
Lumios wrote: Sun Jul 12, 2020 12:59 am Hey Banzai,

Having multiple buttons with the new code, make the previous button disappear. It seems they are all using the same button ID. What do you think? I tried to modify the "buttonid = id" but I got a compiling error. Maybe the button id can be set as an extern variable to keep them unique?

Edit: just tried to set the button id as an extern variable and that didnt work. It seems multiple buttons will conflict with each other.
First, I got the button code from Mario Jemic.

By comparing the two files, we can make a template to copy and paste.

Re: Indicators with ON/OFF buttons

Posted: Sun Jul 12, 2020 3:17 am
by Banzai
Attached is a naked template.

So in the extern section, we make a UniqueButtonID

Code: Select all

extern string             UniqueButtonID        = "Mando";
and then in the Init section, we change the template a little bit.

Code: Select all

int init() //don't change anything here
  {
   IndicatorName = GenerateIndicatorName(UniqueButtonID); 
   IndicatorObjPrefix = "__" + IndicatorName + "__";
   IndicatorShortName(IndicatorName);
   IndicatorDigits(Digits);
   visibility.Init("show_hide_"+UniqueButtonID, IndicatorName, btn_text, button_x, button_y);

//DON'T put the init function here

   return 0;
};

Re: Indicators with ON/OFF buttons

Posted: Sun Jul 12, 2020 3:21 am
by Banzai
Next step is I am supposed to give you a template and an indicator
to show an example.

My mind is blank now.

What indicators are you working now?

Re: Indicators with ON/OFF buttons

Posted: Sun Jul 12, 2020 3:27 am
by Lumios
Thought everyone would enjoy this. Most of the buttons together hehe.

Re: Indicators with ON/OFF buttons

Posted: Sun Jul 12, 2020 3:28 am
by Lumios
There was an issue with the new format on day separator and new format on auto pivot. My mind is blank too haha
Banzai wrote: Sun Jul 12, 2020 3:17 am Attached is a naked template.

So in the extern section, we make a UniqueButtonID

Code: Select all

extern string             UniqueButtonID        = "Mando";
and then in the Init section, we change the template a little bit.

Code: Select all

int init() //don't change anything here
  {
   IndicatorName = GenerateIndicatorName(UniqueButtonID); 
   IndicatorObjPrefix = "__" + IndicatorName + "__";
   IndicatorShortName(IndicatorName);
   IndicatorDigits(Digits);
   visibility.Init("show_hide_"+UniqueButtonID, IndicatorName, btn_text, button_x, button_y);

//DON'T put the init function here

   return 0;
};

Re: Indicators with ON/OFF buttons

Posted: Sun Jul 12, 2020 3:52 am
by Banzai
BOLBAM wrote: Sun Jul 12, 2020 1:02 am
This uni_cross.mq4 needs two more files in order to work.
Snake.mq4 and T3_clean.mq4