One thing i don't understand is what is the <> 9999999? Never seen that before.rogerha wrote: Thu May 27, 2021 3:16 am Actually investigating this further, it is specifically the iCustom call to SuperTrend that is causing the problem. It is coded to make the call once every new bar, and like clockwork, every time it makes that call, the memory usage increases until of course it cannot increase any more. I also make some calls on another custom indi, and that doesn't do the same thing. If I disable the Supertrend call from my code, then they memory usage remains constant. Is there anything in the SuperTrend indi that might not play nicely with iCustom ?
My Code is very simple:Thanks in advance to people.Code: Select all
if ( iCustom(NULL,0,"!SuperTrend cci (arrows + alerts + candles)",60,"Close price",60,"Display line(s)",true,LimeGreen,Orange,1,LimeGreen,Orange,3,Linen,Green,Crimson,8,Linen,Lime,Orange,4,false,false,false,false,false,false,"alert2.wav",true,2,2,"Up in a circle type arrow","Down in a circle type arrow",0.5,0.5,LimeGreen,Orange,5,1) < 9999999 && iCustom(NULL,0,"!SuperTrend cci (arrows + alerts + candles)",60,"Close price",60,"Display line(s)",true,LimeGreen,Orange,1,LimeGreen,Orange,3,Linen,Green,Crimson,8,Linen,Lime,Orange,4,false,false,false,false,false,false,"alert2.wav",true,2,2,"Up in a circle type arrow","Down in a circle type arrow",0.5,0.5,LimeGreen,Orange,5,2) > 9999999 ){ SuperTrend=1; }
Re: Supertrend indicators for MT4
172Well MrTools - I don't have your skill but I noticed that when that particular buffer value goes 'blank' in the data window that it isn't actually zero, but seems to be something like 'infinity' ie. A massive number, So it either has a value of the super trend line or this massive number...... It seems to work, but just this memory leak is a pain..mrtools wrote: Thu May 27, 2021 4:08 am One thing i don't understand is what is the <> 9999999? Never seen that before.
Re: Supertrend indicators for MT4
173Don't worry not questioning your skill at all, just am always learning, was wondering what that was. Might recheck you iCustom calls also the main trend buffer for that is #17 and if = 1 upTrend and =-1 dnTrend.rogerha wrote: Thu May 27, 2021 4:25 am Well MrTools - I don't have your skill but I noticed that when that particular buffer value goes 'blank' in the data window that it isn't actually zero, but seems to be something like 'infinity' ie. A massive number, So it either has a value of the super trend line or this massive number...... It seems to work, but just this memory leak is a pain..
Re: Supertrend indicators for MT4
174Oh that's good to know, thanks MrTools, will take a look at that and see if it improves things. Appreciate your time.mrtools wrote: Thu May 27, 2021 4:35 am Don't worry not questioning your skill at all, just am always learning, was wondering what that was. Might recheck you iCustom calls also the main trend buffer for that is #17 and if = 1 upTrend and =-1 dnTrend.
Re: Supertrend indicators for MT4
175For anybody that might be interested at a later date, I resolved the memory leak with replacing the code earlier in the thread with the code below and calling the iCustom as an Integer. If I am honest - I have only a little understanding as to why that may have fixed the problem - but it may help somebody else down the line. Thanks again for the pointers @Mrtools.
EDIT: Further testing and it hasn't fixed - continuing to research.
Code: Select all
int SupTrendNew = iCustom(NULL,0,"!SuperTrend cci (arrows + alerts + candles)",60,"Close price",60,"Display line(s)",true,LimeGreen,Orange,1,LimeGreen,Orange,3,Linen,Green,Crimson,8,Linen,Lime,Orange,4,false,false,false,false,false,false,"alert2.wav",true,2,2,"Up in a circle type arrow","Down in a circle type arrow",0.5,0.5,LimeGreen,Orange,17,1);
int SupTrendOld = iCustom(NULL,0,"!SuperTrend cci (arrows + alerts + candles)",60,"Close price",60,"Display line(s)",true,LimeGreen,Orange,1,LimeGreen,Orange,3,Linen,Green,Crimson,8,Linen,Lime,Orange,4,false,false,false,false,false,false,"alert2.wav",true,2,2,"Up in a circle type arrow","Down in a circle type arrow",0.5,0.5,LimeGreen,Orange,17,2);
if (SupTrendNew==1 && SupTrendOld==-1){SuperTrend=1;}
if (SupTrendNew==-1 && SupTrendOld==1){SuperTrend=0;}
Re: Supertrend indicators for MT4
176So were you able to find this indicator? Mind sharing the indicator here? Is it a repainter?RomanSoft wrote: Sat Mar 27, 2021 4:05 pm Hello Dear Friends.
I looking for some indicator on screen. Indicator without vertical lines.
Please help me find it.
Thank you very much.
Re: Supertrend indicators for MT4
177Hi MrTools i try to change your supertrend more simple indicator without drawing and success. But i failed change to EA. Can you help me?
Re: Supertrend indicators for MT4
178That's not my supertrend.thejackmurder wrote: Tue Jun 08, 2021 1:08 pm Hi MrTools i try to change your supertrend more simple indicator without drawing. But i failed change to EA. Can you help me?
Re: Supertrend indicators for MT4
179
I see "#property copyright "Copyright 2016, mladen - MetaQuotes Software Corp.". Is it yours MrTools?. If yes,this source which i try to change more simple. Can you helpme to create EA from my edited code?
Re: Supertrend indicators for MT4
180hi, mrtools , is it possible to add standard error and standard deviation in addition to ATR. thank you inadvancemrtools wrote: Sun Jan 31, 2021 1:25 pm Added it as an option on this version.
PS: For the Histogram version of the new Supertrend, please see here: Supertrend Averages (New Format) Histogram MT4.