Why The Class Constructor executes every time the Stategy runs?
Author: ivraju
Creation Date: 8/18/2009 11:32 AM
profile picture

ivraju

#1
CODE:
Please log in to see this code.


when I execute the Strategy second time I am expecting Value "30" only.

I thought that the Class constructor executes only when I open the startegy and for all subsequent runs only the Execute() method gets executed.
But the results from this example show that the Class Constructor is running every time the Stategy runs? Am I missing something here?

profile picture

Eugene

#2
Unless you hit "Compile" in the middle, the Strategy should produce "30" for all subsequent runs (this is what I'm seeing).
profile picture

Cone

#3
Note: Clicking "Run the Strategy" compiles and runs the strategy. Just hit F5, Go, or click a symbol to run a Strategy that is already compiled.
profile picture

ivraju

#4
Got it. I am clicking "Run the Strategy" button, that is why I am seeing those results.

Thank you.
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).