!!!-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
201- These users thanked the author Banzai for the post (total 2):
- KAESER444, DaffyTaffy
milad1987 wrote: Fri Jul 10, 2020 1:09 am
hello BOLBAM ; can you share your arrow indicator in your chart ?
First, I got the button code from Mario Jemic.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.
Code: Select all
extern string UniqueButtonID = "Mando";
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;
};
Banzai wrote: Sun Jul 12, 2020 3:17 am Attached is a naked template.
So in the extern section, we make a UniqueButtonIDand then in the Init section, we change the template a little bit.Code: Select all
extern string UniqueButtonID = "Mando";
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; };
This uni_cross.mq4 needs two more files in order to work.
Users browsing this forum: ChatGPT [Bot], DotNetDotCom [Bot], ffsss, gmpleyland, Majestic-12 [Bot], sdsdzk, Tradehunter, TransparentTrader and 121 guests