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.
Size:
Color:
Strategy? Data? Settings?
Size:
Color:
Own Strategy, own Data, same settings in both windows.
I have the suspicion that this could have sth. to do with synchronization?
Size:
Color:
Yes, that's possible.
Size:
Color:
It had sth to do with Filehandling and errors that were not catched.
Size:
Color:
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?
Size:
Color:
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.
Size:
Color:
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.
Size:
Color:
On the surface, nothing seems to be 'collected' from a run to run here, unless global memory is being used elsewhere.
Size:
Color:
When is global memeory used? How can I detect that? What are typical methods that use global memory.
Size:
Color:
If you're asking about it, it's a sign that your strategy probably isn't using SetGlobal/GetGlobal etc.
Size:
Color:
Hmm.
When I compile the code I get 92 trades again, which is correct.
Size:
Color:
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.
Size:
Color:
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?
Size:
Color: