backtest "no memory for ticks generating"

 
my computer cpu 12900k ,128gb memory, 16TB harddisk, and i backtest 5 years every tick base on real tick with 1 currency pair , it still said not enough memory to generating , even the ram only use 50% , anyone can teach me how to do?



thank you for answer, i love you all
 
Sheldon Kam: my computer cpu 12900k ,128gb memory, 16TB harddisk, and i backtest 5 years every tick base on real tick with 1 currency pair , it still said not enough memory to generating result or something(backtest will let the memory usage goto 100%) , even backtest is still running , but no more result output , i already try many many way search from internet, still don't know how to fix it, my ea not difficult , the only part i think use many memory is every tick 1 time iClose , but .... it is a main point?? thank you for answer, i love you all

I use "Every tick based on real ticks", with no difficulty even on multi-symbol — Intel Core i7-4790T @ 2.70GHz, 16GB RAM, 1TB SSD (Windows 10 Pro 64-bit) .

I do however, always try to make my code as efficient as possible, both in speed and memory usage.

There is no need to read iClose() on every tick (that would be the same as the current Bid price). I only read previous bar's OHLC data and indicator data on new bar only (and even then, only if needed).

 
Fernando Carreiro #:

I use "Every tick based on real ticks", with no difficulty even on multi-symbol — Intel Core i7-4790T @ 2.70GHz, 16GB RAM, 1TB SSD (Windows 10 Pro 64-bit) .

I do however, always try to make my code as efficient as possible, both in speed and memory usage.

There is no need to read iClose() on every tick (that would be the same as the current Bid price). I only read previous bar's OHLC data and indicator data on new bar only (and even then, only if needed).

hello brother, thank you your reply , can you teach me the function 1 candle only do 1 time, because my iClose is for this, thank you
 
Sheldon Kam #: hello brother, thank you your reply , can you teach me the function 1 candle only do 1 time, because my iClose is for this, thank you

Code Base

Detecting the start of a new bar or candle

Fernando Carreiro, 2022.04.24 00:38

Detecting the start of a new bar or candle, in the OnTick() event handler of an expert advisor.
 
Fernando Carreiro #:
thank you , love you
 
Fernando Carreiro #:
Thanks to you, I discovered something new again. Thank you very much
 
Sheldon Kam #: thank you , love you
Nguyen Trong Thanh #: Thanks to you, I discovered something new again. Thank you very much

You are welcome!

 
Sheldon Kam:
my computer cpu 12900k ,128gb memory, 16TB harddisk, .....

Do not double post!!!!!!!

You already had replies here.

I have deleted your duplicated topic!

 
Keith Watford #:

Do not double post!!!!!!!

You already had replies here.

I have deleted your duplicated topic!

oh sorry , i forget i open a post with no picture before
 
hello every brother , the problem still no fix ..... help me please
 
Sheldon Kam #: hello every brother , the problem still no fix ..... help me please

You need to improve your code. It is too "bulky" and using too many resources. Programming is not just about writing lines of code. It has to be "good" code if want it to work correctly and efficiently.

If I'm able to do, not only single back-tests, but also full optimisations on 16GB RAM / 1TB drive, then that just shows you how inefficient your code is if you can't even do a simple back-test with 128GB RAM / 16TB drive.

Reason: