Single Symbol vs. All Symbols in DataSet: skipped trades?
Author: dansmo
Creation Date: 3/11/2010 3:13 AM
profile picture

dansmo

#1
Hi,

I am somehow confused with my result:
If I test a strategy on a whole dataset lots of trades are skipped compared to when I run it on a single symbol.

* settings are absolutely identical
* "Tardes not included" says 0 in both windows.

Where could this difference come from? Any hints?

Edit1: all skipped trades seam to be at the beginning of the period.
profile picture

Eugene

#2
Strategy? Data? Settings?
profile picture

dansmo

#3
Own Strategy, own Data, same settings in both windows.

I have the suspicion that this could have sth. to do with synchronization?
profile picture

Eugene

#4
Yes, that's possible.
profile picture

dansmo

#5
It had sth to do with Filehandling and errors that were not catched.
profile picture

dansmo

#6
Follow up question:

I did the following:

1. Run the script on a certain symbol and getting 92 trades
2. change to another symbol
3. go back to the first symbol and notice: 80 trades.

What could be the reason of sth. like this?
profile picture

Eugene

#7
Sorry for my lack of telepathic abilities, this is why I'm not a fan of guesswork. ;) You have to show a code fragment sufficient to reproduce the issue, along with other parts of the puzzle such as symbols, data range and settings.
profile picture

dansmo

#8
I know....but sometimes you give a hint in the right direction just because you have more experience.

so, lets go into detail:


I cannot provide all the code, but I think the problems are somewhere here.
DebugPrints will show False for the beginning of the bars in Step 1. At step 3 it will show true. So I guess there is something "collected" from one run to the next?
CODE:
Please log in to see this code.


CODE:
Please log in to see this code.
profile picture

Eugene

#9
On the surface, nothing seems to be 'collected' from a run to run here, unless global memory is being used elsewhere.
profile picture

dansmo

#10
When is global memeory used? How can I detect that? What are typical methods that use global memory.
profile picture

Eugene

#11
If you're asking about it, it's a sign that your strategy probably isn't using SetGlobal/GetGlobal etc.
profile picture

dansmo

#12
Hmm.
When I compile the code I get 92 trades again, which is correct.
profile picture

Eugene

#13
QUOTE:
So I guess there is something "collected" from one run to the next?

One thing that I forgot to mention: if class level (class-scope) variables are used in your code, they are initialized only when the class is instantiated. It happens when a Strategy window is opened, or "Run the Strategy" is clicked, or after clicking "Compile". Hitting just the "Go" button without recompiling after making some change can explain "memory effect" like that.
profile picture

dansmo

#14
What I use as class is this:

CODE:
Please log in to see this code.


I just found the following. If I do steps 1 to 3, and have a symbol that does not have a file (where the series will be filled with zeros), step 3 will produce 92 trades.

Apert from finding this error:
If there is a memory effect, how can one prevent it from happening in a portfolio simulation?
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).