Using IOData.dll in Optimization with Multi-cores CPU

Questions about MultiCharts and user contributed studies.
hbscreener
Posts: 10
Joined: 20 Nov 2018
Has thanked: 6 times

Using IOData.dll in Optimization with Multi-cores CPU

Postby hbscreener » 13 Oct 2021

Hi, I am trying to use the RFile and InData functions of IOData.dll to read text files in the portfolio trader. Everyting is working fine until I start the optimization. The optimization results vary every time, even though all parameters remain the same. This problem annoyed me for a few days. Until today, I realize that it may be related to the CPU cores. If I limit the portfolio trader to use only 1 CPU core, the optimization result is consistent every time. Now that I just want to know if there is anything I have missed when using IOData.dll with multicores of CPU in optimization? Thanks in advance.

Code: Select all

var: line(0), idx(0), total(0); var: str(""); Once begin line = RFile("c:\\abc.csv"); //abc.csv contains a list of numbers for idx = 0 to line - 1 begin str = InData(idx); total = total + StrToNum(str); end; end; //the value of total vary every time in optimization print(total);

User avatar
Tammy MultiCharts
Posts: 200
Joined: 06 Aug 2020
Has thanked: 6 times
Been thanked: 65 times

Re: Using IOData.dll in Optimization with Multi-cores CPU

Postby Tammy MultiCharts » 13 Oct 2021

Hello hbscreener,

You are right, the discrepancies are related to the number of CPU cores utilized during the optimization.
Several parallel calculations of the strategy with different inputs are run during the optimization, if more that 1 thread is used.
If the file is modified during each calculation, the optimization results are supposed to be different each time.
You should also check with IOData.dll developers if it supports multithread calculation.

hbscreener
Posts: 10
Joined: 20 Nov 2018
Has thanked: 6 times

Re: Using IOData.dll in Optimization with Multi-cores CPU

Postby hbscreener » 13 Oct 2021

Hello hbscreener,

You are right, the discrepancies are related to the number of CPU cores utilized during the optimization.
Several parallel calculations of the strategy with different inputs are run during the optimization, if more that 1 thread is used.
If the file is modified during each calculation, the optimization results are supposed to be different each time.
You should also check with IOData.dll developers if it supports multithread calculation.
Thanks, Tammy.

My text file is a static one, so the optimization results should not be different each time.

I do not know the developer of IOData.dll, do you have his/her contact?

By the way, apart from using IOData.dll, what other methods supporting multithread calculation can be used to read an external text file?

Thanks again.

User avatar
Tammy MultiCharts
Posts: 200
Joined: 06 Aug 2020
Has thanked: 6 times
Been thanked: 65 times

Re: Using IOData.dll in Optimization with Multi-cores CPU

Postby Tammy MultiCharts » 14 Oct 2021

Hi hbscreener,

IOData.dll was not developed by us, so unfortunately we don't have that information.
You can try using another third-party DLL, ELcollections. It can be downloaded here.


Return to “MultiCharts”