Errors, bugs, questions - page 2280

 
void f( int = 0, ) {}

Is it correct that it compiles without errors?

 
Ilyas:

You have run into a memory feature in Windows

Right after ArrayResize add

This will initiate the actual allocation of physical memory so this will not happen during the test.


Here are the results from my computer

Yes, it does indeed work.
Thank you.
Very interesting. It's not clear though.
I should know that to work quickly with memory after ArrayResize you need to do a full array initialization with ArrayInitialize or ArrayFill (it works both ways). ArrayInitialize is simpler.

I tried to initialize each 4096 array items. But it doesn't affect performance improvement of ArrayFill.

for (int i=0;i<size;i+=4096) arr[i]=0;
 
Nikolai Semko:

Let's know that for fast memory handling after ArrayResize you should do full array initialization with ArrayInitialize or ArrayFill (works both ways). With ArrayInitialize it is easier.

You must have made a wrong conclusion. Everything works fast in any case. It's just that in the "slow" variant you were measuring in addition to filling also the actual memory allocation, because ArrayResize is an intention to allocate memory, not the allocation itself.

 
fxsaber:

You have drawn the wrong conclusion. Everything works fast as it is. It's just that in the "slow" version you were measuring the actual memory allocation in addition to filling, because ArrayResize is an intention to allocate memory, not the allocation itself.

Yes, you are right.

Thank you!
And I was also wrong, when I said that the link ArrayInitialize + ArrayCopy worked faster, because I filled the array with the same values I'd filled before with ArrayFill. The compiler is just smart and doesn't do the same job twice.
If we fill the array with other values, the result will be different:

2018.09.06 12:10:36.602 TestArrayFill (EURUSD,H1)       Время заполнения через ArrayFill первая попытка= 299
2018.09.06 12:10:36.602 TestArrayFill (EURUSD,H1)       Время заполнения через ArrayInitialize + ArrayCopy = 425
2018.09.06 12:10:36.602 TestArrayFill (EURUSD,H1)       Время заполнения через ArrayFill вторая попытка = 78

So I screwed up. Sorry.
Let's continue to use ArrayFill in working order.

Files:
 

Why has my country of residence changed in my profile?
For the last three years it was Canada. I did not change it. And now I can't change it.

I.e. the initial country of residence at registration is forever. Even if you do not live in Russia and have become a resident or citizen of another country?

 
Let me know, will you address this problem or not?

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

fxsaber, 2018.09.06 09:31

Why does this sometimes happen? The tester closes positions not on the last tick, but on the penultimate tick. The situation is on some custom symbols.

If a replay is needed, ready to provide.


Why is it important? On custom symbols with exchange execution, markets are executed at Last Price. For custom symbols, the tick history is bid/ask, without last. Therefore, on such symbols, the tester closes current positions on the last tick by zero last. The solution is to force last = (bid + ask) / 2 in the last tick. However, there are situations when the Tester, for some reason, closes everything not at the last, but at the next-to-last tick, where last is zero. As a result, we have the following chart


You look at the optimization results and see some huge amount of profit/loss. You won't realise it's a bug until you run a single test and look at the end of the trading history.

 
Nikolai Semko:

Why has my country of residence changed in my profile?
For the last three years it was Canada. I did not change it. And now I can't change it.

I.e. the initial country of residence at registration is forever. Even if you do not live in Russia and have become a resident or citizen of another country?

You are registered as a seller from Russia. If you would like to make changes to the seller's registration details, welcome

 
 
fxsaber:
Let me know if you are going to deal with this problem or not?
We'll look into it
 
Marsel:

You are registered as a seller from Russia. If you would like to make changes to the seller's registration details, welcome

Tell me where these settings are hidden? I cannot find them. There is no such option in the SD either.
Reason: