Reducing RAM

 

Hi Guys...

Can any of you give me a few pointers on how to reduce my EA's RAM... specifically Indicators that I use on my GUI (Graphical Interface)...

Most of my heavy "lifting" is done with Arrays and Global variables...but,...

I have a GUI that is split into 3  - Chart "0" - the main MT4 chart window... and then 2 other chart windows... See attached: 

Files:
Rhythm_GUI.png  31 kb
 

I then "overlay" my EA onto that "Template"... which gives me this:

Files:
 

My problem is... that the 2 indicators in Window 1 and 2 are drawing too much power... they are very complex and just hammer the RAM... but, I already have the Arrays setup in the EA...

Is there any way that I can :Create" these indicators in an #Include file... so that they can simply work of the Global Arrays and not add strain to the system... "Just because it looks pretty"...


I have been able to do this with other indicators on the "Chart_Window"... but I can't work out how to do this in the "Separate" Windows....


Any idea's...? (if you are following me that is..)

...sorry... this might be a better ScreenShot of Rhythm...

 

RAM doesn't mind being hammered, don't worry about it. You can set tools/settings/graphics/max bar to 5000 if you don't use much history every day.

If it's CPU that it's hammering you probably need to optimize the code to do less cycles or less operations per cycle.

 
kypa:

RAM doesn't mind being hammered, don't worry about it. You can set tools/settings/graphics/max bar to 5000 if you don't use much history every day.

If it's CPU that it's hammering you probably need to optimize the code to do less cycles or less operations per cycle.

Thanx Kypa... but it does count when you are dealing with VPS's....

It's also just personal... 

 
MikeT:

Thanx Kypa... but it does count when you are dealing with VPS's....

It's also just personal... 

PS: I never use more than 100 bars Max History...

 

I didn't read it's MT4, in MT5 5000 is the minimum. 100 is even better.

You can use floats instead of doubles, char instead of some int or long (where possible), but I doubt it will have visible effect. 100 elements double array is less than a kilobyte.

You can use a single chart and change symbols on it if you're trading multiple markets, so only one copy runs of EA is running.

How much RAM does it use?

 

Hi Kypa...

I don't think that you are fully following me here... I already have the code clean... I'm just wondering how I can get those 2 indicators "Chart1 & 2" to draw info that is already sorted out in my Global Array's/Variables.. but. I appreciate the feed-back...


Umm... at the moment she is running stable at 300Megs.... but I'd like to get her down to 250ish...

 
MikeT:

Hi Kypa...

I don't think that you are fully following me here... I already have the code clean... I'm just wondering how I can get those 2 indicators "Chart1 & 2" to draw info that is already sorted out in my Global Array's/Variables.. but. I appreciate the feed-back...


Umm... at the moment she is running stable at 300Megs.... but I'd like to get her down to 250ish...

Show your code if you need coding help.
 

Thanx Alain...

I don't really need coding help... I was just wondering if anyone could help put me in the right direction as to how to put an Indicator into an #Include file... Ummm... not really sure what else to say... My 2 indicators at the bottom of my GUI are really loading things up... and their information is already captured withing the code... so they are just there as "Window dressing" I guess.... I was just wondering if I could get them to draw the same variables from within my code as to "Calling" all the indicators again... if that makes sense...

 

Sorry Kypa... I thought I was on the Mql4 Forum... As a matter of interest... I have been wanting to change over to Mql5 for ages now.... but just hav'nt had the balls... like giving up smoking I guess... 

Do you have enough experience in both Mql4 and Mql5 to give me decent opinion on which one to code with...? I'd rather know 70% of something than 30% of nothing... If you know what I mean... 

Reason: