Championship 2007 Question

 
Hello,
in the rules there is a point about looping and use of memory.
because i will use a while loop to get real time prices for 3 currencies i have a alltime while loop!
is this possible, what minimum sleeping time i have to choose for saving your memory?

can someone help me?

thanks
 
Not all while loop is looping. Looping means indefinite or excessive number of iterations in a loop which eventually will hog the cpu resources.
So we have to conserve the cpu resource (Although I don't understand why it's translated to 5 minutes backtest time for 8 months data).

Saving memory is another thing we have to take care of. Allocating excessive number of variables or strings probably will eat more memory space.
 
fireflies:
Not all while loop is looping. Looping means indefinite or excessive number of iterations in a loop which eventually will hog the cpu resources.
So we have to conserve the cpu resource (Although I don't understand why it's translated to 5 minutes backtest time for 8 months data).

Saving memory is another thing we have to take care of. Allocating excessive number of variables or strings probably will eat more memory space.
thanks for fast answer.
so is no problem to do a while loop with a Slepp(500) time to get allways news prices?
or will this use to much of the cpu reserves?

when i will send in my EA will this be checked too? the problem is backtesting of more then one currency is not possible in metatrader.
 
hello12345:
thanks for fast answer.
so is no problem to do a while loop with a Slepp(500) time to get allways news prices?
or will this use to much of the cpu reserves?

when i will send in my EA will this be checked too? the problem is backtesting of more then one currency is not possible in metatrader.
:) Can't answer that. I'm just a contestant too. I haven't submit mine, so I don't know.

But why you use sleep(500) waiting for news prices? the start() is always called for every tick price when it's not already executing the start().
And sleep() actually reduces cpu usage.
 
fireflies:
hello12345:
thanks for fast answer.
so is no problem to do a while loop with a Slepp(500) time to get allways news prices?
or will this use to much of the cpu reserves?

when i will send in my EA will this be checked too? the problem is backtesting of more then one currency is not possible in metatrader.
:) Can't answer that. I'm just a contestant too. I haven't submit mine, so I don't know.

But why you use sleep(500) waiting for news prices? the start() is always called for every tick price when it's not already executing the start().
And sleep() actually reduces cpu usage.
i will trade in 3 currencies. if i use start, then i got only actuell prices in the other 2 currencies by the time of my basic currency (my EA in the chart).
ok my failure. i wrote "news" prices but mean "new" prices :-). sorry
 
hello12345:
i will trade in 3 currencies. if i use start, then i got only actuell prices in the other 2 currencies by the time of my basic currency (my EA in the chart).
ok my failure. i wrote "news" prices but mean "new" prices :-). sorry
Ok. I see what you mean.
Yeah I suppose you can use sleep(500). I'd prefer to just use the start() with the EA applied to the most volatile chart from the pairs I use. I may miss one or two ticks, but it's ok I guess. Your preference may be different.
 
fireflies:
hello12345:
i will trade in 3 currencies. if i use start, then i got only actuell prices in the other 2 currencies by the time of my basic currency (my EA in the chart).
ok my failure. i wrote "news" prices but mean "new" prices :-). sorry
Ok. I see what you mean.
Yeah I suppose you can use sleep(500). I'd prefer to just use the start() with the EA applied to the most volatile chart from the pairs I use. I may miss one or two ticks, but it's ok I guess. Your preference may be different.
but until now my problem is i cant backtest my EA with while looping! without while loop all is ok, but with there are big problems and nothing happens in backtesting.
is this normal for while looping?
 
hello12345:
but until now my problem is i cant backtest my EA with while looping! without while loop all is ok, but with there are big problems and nothing happens in backtesting.
is this normal for while looping?
Because the EA never exits the start(), all market values don't change during start() execution.
You need to get new market values using RefreshRates() after woken up from sleep().
BTW. sleep() is ignored in backtest.
 
fireflies:
hello12345:
but until now my problem is i cant backtest my EA with while looping! without while loop all is ok, but with there are big problems and nothing happens in backtesting.
is this normal for while looping?
Because the EA never exits the start(), all market values don't change during start() execution.
You need to get new market values using RefreshRates() after woken up from sleep().
BTW. sleep() is ignored in backtest.

thats not the problem, i refresh it allways after sleeping. in demo account the trading is also fine, all ist perfect, but i dont know why there are problems in backtesting.
i can backtest it without the while loop, and can use it with while loop in demo account without any errors!
 
hello12345:
thats not the problem, i refresh it allways after sleeping. in demo account the trading is also fine, all ist perfect, but i dont know why there are problems in backtesting.
i can backtest it without the while loop, and can use it with while loop in demo account without any errors!
I wonder what you put inside the loop.
If you are trading multipair currency, it can't be tested using strategy tester.
You have to modify it so it is tested one pair at a time.
 
fireflies:
hello12345:
thats not the problem, i refresh it allways after sleeping. in demo account the trading is also fine, all ist perfect, but i dont know why there are problems in backtesting.
i can backtest it without the while loop, and can use it with while loop in demo account without any errors!
I wonder what you put inside the loop.
If you are trading multipair currency, it can't be tested using strategy tester.
You have to modify it so it is tested one pair at a time.

i put in most of my EA code. i tested it in only 1 currency, so this must be ok. but still not.only livetrading and testing in strategytester with no while loop is possible.
its a simple : while(isconnected() && !isstopped(()) { sleep(500);refreshrates(); rest of code }
i write here all in small letters, so dont think i did some lettermistakes in the code.