Re: MT4 Indicator requests and ideas

10271
cvdm7756 wrote: Fri Jul 10, 2020 2:45 am Good Day Mr Tools,
Do you have in your collection of tools, an Indicator which Alerts to a Moving Average - SMA, EMA, LWMA,HMA crossing of The Daily Open Level or a Fixed Price Level?
If you have not one on hand, would you please be kind enough to code a Non Lagging MA (from a selection of the above Moving averages) when the Ma Cross and/or Price Candle open either on the Upside or the Downside of the Daily Open Level or selected Fixed Price Level?

Your assistance in this regard would be much appreciated.

Thank you.
Have this histogram, now it's coded for close but can be easily changed to open.
These users thanked the author mrtools for the post:
pipsquirrel


Re: MT4 Indicator requests and ideas

10272
daro84 wrote: Fri Jul 10, 2020 7:38 am

Hi mrtools
Wonder if you can fix the alarm code of this indi since the mql4 was not released (i think, i didnt find it).
I use some indis in Renko charts, and I detected sometimes it keeps giving the alarm+alert on every price movement. I also found that other indis coded the same way dont have this issue, so I checked 2 open source indis with and without the issue and found and fixed the code that keeps the alert repeating forever at least in Renko charts.

The ones having the issue are indis with alert code as follow (as example):

Code: Select all

doAlert(" Buy")
and found that adding the "loop bar" fixes the issue:

Code: Select all

doAlert(whichBar," BUY");
and of course, the corrections on the functions code.

Code: Select all

void doAlert(int forBar, string doWhat)
{
   static string   previousAlert="nothing";
   static datetime previousTime;
   string message;
   
      if (previousAlert != doWhat || previousTime != Time[forBar]) {
       previousAlert  = doWhat;
       previousTime   = Time[forBar];
I think you will catch me hahahA
I didnt test them in normal candles, maybe this is only happening with renko/offline charts but if you can fix it I will appreciate it.
Thank you
Damian
Should have that code on my laptop which is down now, will look at it once I get it working.




Who is online

Users browsing this forum: IBM oBot [Bot], ken0324ken, TransparentTrader and 140 guests