In WL6 StrategyName property was used.
I looked at UserStrategyBase methods/properties but couldn't find the equivalent.
I looked at UserStrategyBase methods/properties but couldn't find the equivalent.
Rename
StrategyName it is.
CODE:
WriteToDebugLog(this.StrategyName);
Allow me to clarify, WL6 stategyname was able to get the strategy file name. How can I get it that with WL7?
I get it like this:
It works for compiled strategies. Maybe it works for other strategies as well.
CODE:
this.ToString().Split(".")[^1]
It works for compiled strategies. Maybe it works for other strategies as well.
QUOTE:
It works for compiled strategies. Maybe it works for other strategies as well.
At the moment, it won't work in code-based strategies.
QUOTE:
Allow me to clarify, WL6 stategyname was able to get the strategy file name. How can I get it that with WL7?
What's the purpose of getting the strategy's .txt file name?
QUOTE:
What's the purpose of getting the strategy's .txt file name?
The testing scripts are numbered (X1, X2, etc) for version control. The actual trading scripts are named simply "X".
The script behaves based on its name. So, for example, in testing the debugging is turned on, and "production" it's off. There are other examples/reasons.
This methodology worked great in WL6 and it would be a big time-saver not having to devise new methods.
You do have the this.StrategyName, and I can't see it in your response doesn't why you think you need the file name. Moreover, there is no file name for compiled strategies.
The code returns: "MyStrategy".
Using the methodology I mentioned above I can't tell if this is a test/debug script or "production".
I'm still new to WL7. Let's see if I can devise another way.
Using the methodology I mentioned above I can't tell if this is a test/debug script or "production".
I'm still new to WL7. Let's see if I can devise another way.
I see. File name is decoupled from UserStrategyBase so the property returns the class name - which you can adjust to mark test strategies accordingly.
Your Response
Post
Edit Post
Login is required