I created a strategy that calls an indicator using CreateIndicator and GetIndicatorValue. When I run this strategy in the optimizer it opens a new indicator window for every value it tries (because each one uses a different parameter in the indicator). This quickly clogs up the memory and slows the optimization to a crawl. I temporarily solved this problem by hard-coding the indicator into my strategy (it no longer calls an external indicator) but I hope there's a way to avoid doing this with every strategy I write.
It might help if I could get the indicators created by a strategy to be deleted when the strategy is deactivated, but I haven't figured that out (see my previous, unanswered post in this forum)
Can you help me with this, Mike?
Strategy Optimizer acting strangely...
- Tantalus
- Posts: 302
- Joined: Fri Mar 23, 2007 3:51 pm
- Contact:
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
Re: Strategy Optimizer acting strangely...
Tantalus wrote:I created a strategy that calls an indicator using CreateIndicator and GetIndicatorValue. When I run this strategy in the optimizer it opens a new indicator window for every value it tries (because each one uses a different parameter in the indicator). This quickly clogs up the memory and slows the optimization to a crawl. I temporarily solved this problem by hard-coding the indicator into my strategy (it no longer calls an external indicator) but I hope there's a way to avoid doing this with every strategy I write.
It might help if I could get the indicators created by a strategy to be deleted when the strategy is deactivated, but I haven't figured that out (see my previous, unanswered post in this forum)
Can you help me with this, Mike?
This situation shouldn't happen, I need to see the code. Strategy optimizer removes all the indicators after each pass.
Hasta la vista
Mike
Mike
- Tantalus
- Posts: 302
- Joined: Fri Mar 23, 2007 3:51 pm
- Contact:
OK, I've attached the source for the strategy as well as the indicator that it calls. I did a little more testing and here is what I'm seeing:
I run the strategy optimizer, and it works but it gets slower and slower with each passing iteration.
When it's finished, I close the strategy optimizer window and in the testing mode window I click on the indicator list button. It shows that there's an indicator open for each iteration of the indicator that was used.. for example, if I optimize for the indicator parameter 'period' and run it from 3 to 15, there will be an open indicator for each of these values (13 total). But no indicator window is showing on the screen.
Then I click the 'delete all' button, the screen flashes a bit and suddenly all of the indicator windows appear on the screen.. usually it completely covers the price chart. No matter how many times I click the 'delete all' button, it won't delete the indicators..
Then, I close the indicator list dialog, click the connect button (as if I was going to start testing) then I disconnect again. NOW, it will allow me to delete the indicator windows.
I hope this info helps you figure out the problem.
I run the strategy optimizer, and it works but it gets slower and slower with each passing iteration.
When it's finished, I close the strategy optimizer window and in the testing mode window I click on the indicator list button. It shows that there's an indicator open for each iteration of the indicator that was used.. for example, if I optimize for the indicator parameter 'period' and run it from 3 to 15, there will be an open indicator for each of these values (13 total). But no indicator window is showing on the screen.
Then I click the 'delete all' button, the screen flashes a bit and suddenly all of the indicator windows appear on the screen.. usually it completely covers the price chart. No matter how many times I click the 'delete all' button, it won't delete the indicators..
Then, I close the indicator list dialog, click the connect button (as if I was going to start testing) then I disconnect again. NOW, it will allow me to delete the indicator windows.
I hope this info helps you figure out the problem.
- Attachments
-
- RegSlopeStrategy_01.zip
- (1.09 KiB) Downloaded 865 times
-
- RegSlope.zip
- (811 Bytes) Downloaded 828 times
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
- Tantalus
- Posts: 302
- Joined: Fri Mar 23, 2007 3:51 pm
- Contact:
- Terranin
- Site Admin
- Posts: 833
- Joined: Sat Oct 21, 2006 4:39 pm
Tantalus wrote:I'm using Version 1, Build 11, downloaded within the last 2 - 3 weeks.
I'll try it with some more indicators and strategies and see if I still get the same results.
Perhaps the indicator object should be destroyed after use ? Is there a way to do this in a strategy code?
Your code seems correct. I do not know where is the problem.
Hasta la vista
Mike
Mike
Who is online
Users browsing this forum: No registered users and 21 guests