Determine from where Execute() is called
Author: Ben_Zurich
Creation Date: 10/3/2012 2:55 AM
profile picture

Ben_Zurich

#1
My strategy contains some heavy processing just to display things (like zigzag vertical lines).

When optimizing, I'd like to suppress this processing.

How can I determine whether Execute() was called from the optimizer or just by activating the 'Go' buttom?
profile picture

Eugene

#2
You don't have to suppress processing of cosmetic chart methods because the Optimization and the Strategy Monitor tool skip the drawing stuff.
profile picture

Eugene

#3
QUOTE:
How can I determine whether Execute() was called from the optimizer or just by activating the 'Go' buttom?

See ChartPane object > "IsPricePane Property" or Cosmetic Chart > "ChartStyle Property" in the QuickRef.
profile picture

Ben_Zurich

#4
It's not only the cosmetic charting that I want to suppress but foremost the extensive preprocessing that takes place before that happens.

And yes, this helped, thank you very much! Refering to the QuickRef you mentioned, IsStrategyMonitor() is true while optimizing, and false when pressing "Go". This is exactly what I was looking for.

By the way, do you have a list of all callback routines like IsStrategyMonitor()?
profile picture

Cone

#5
The QuickRef contains all supported WealthScript functions. Where did you find IsStrategyMonitor?
profile picture

boreland

#6
For completeness: taken from QuickRef
CODE:
Please log in to see this code.
:

profile picture

Cone

#7
So, IsStrategyMonitor() is a private boolean method [that Eugene or I created] which determines if a Chart is displayed while the script is running. :)
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).