currency strength (Phy, Barrowboy, Cloudbreaker, ...)

Dua Yong Rew
5718
Dua Yong Rew  

need some help from the gurus here


can check how to reduce the memory for this ea?

Files:
Brian Dee - Random Trader
1756
Brian Dee - Random Trader  

What an honour, to be included with those two esteemed oracles!

Dont forget that there are several other excellent contributors on here...

My 2c worth is to do the Bid Ration stuff in a couple of indicators - one indi wont cut it as you can only have a max of 7 outputs

Also, try not to do everything on every tick - maybe that wont help on this one as you could be after transient Hi/Lo's, an FPI kind of thing..?

Good Luck

-BB-

Dua Yong Rew
5718
Dua Yong Rew  
BarrowBoy:

What an honour, to be included with those two esteemed oracles!

Dont forget that there are several other excellent contributors on here...

My 2c worth is to do the Bid Ration stuff in a couple of indicators - one indi wont cut it as you can only have a max of 7 outputs

Also, try not to do everything on every tick - maybe that wont help on this one as you could be after transient Hi/Lo's, an FPI kind of thing..?

Good Luck

-BB-


just this ea is eating 50mb of ram.

i need to code it using less mem...

[Deleted]  

Hey, thanks for the compliment.


Had a look at your code.


My logic says here are the options:

- Throw more memory at the problem ---> 50mb isn't that expensive; I guess it depends upon your deployment strategy

or

- Do less ---> only you know what you're trying to achieve, and if your calculations could be short-cutted; would declaring the variables once in init() - rather than each run of start() or BR() make a difference - worth a try

- Do it less often ---> could you perhaps only execute on a change of bar; could you cycle the calculations so that each currency has its turn with each tick to refresh its calculation

- Look for the wildcard ---> could it be that this will take less memory when run outside of strategy tester


CB

William Roeder
23721
William Roeder  

1) Change those Print();Print() to one Comment(...,"\n",...) Prints are cache in ram (for the journal) and on disk.

2) Compute them less often (not once every tick)

Dua Yong Rew
5718
Dua Yong Rew  
WHRoeder:

no improvement

cloudbreaker:



im using a VPS, therefore need to make it less memory

trader2
3
trader2  
Al W
163
Al W  
TRADER2:
technical analysis 8/12/2009

EUREKA!

:)


Anyway, dushur. 2 things that always causes memory issues in mt4 is the amount of bars loaded on chart, and amount of different symbols you use at the same time.

Since your EA relies on many different symbols at the same time, you only have one option, and that's to limit amount of bars on your chart. That's an easy fix.

Tools -> Options ->Charts tab -> Max Bars on chart

Change it to something reasonable for your strategy. Do you need more than 50,000 bars for your EA? For backtesting, yes, but not for live trading usually.

After you make the change close metatrader and open it back up and it should reflect the change.


Hope that helps.