- ago
Scenario: I have a C# strategy that is also saved in the Strategy Monitor (SM) inside a Workspace.
---------------------------------------

I made a small tweak to the Strategy's Parameters a couple of days ago and also saved them to Strategy Defaults in the code. Since that time WL8 has been opened and closed several times so there's been ample opportunity for the changes to percolate through to the SM.

Today, when I ran the strategy independently it generated signals but when I ran it inside the Workspace's saved SM it didn't generate any. Opening the Configure option in the SM revealed that none of the changes had carried through (it was still using old slider values) even though they had been saved to code.
Note: I did not check to see whether this behavior is true inside other modules such as MetaStrategy also.

One expects the current version of the strategy to be reflected inside all WLab modules. Hope this gets fixed soon.
0
735
35 Replies

Reply

Bookmark

Sort
- ago
#1
Have you removed from and added the strategy to the SM? No. Then this strategy instance is initialized with the parameters saved with the workspace.
0
- ago
#2
As long as the strategy's name is not changed and it has its own unique ID one expects the current (latest) version of the strategy to be used everywhere.

If I need to use different parameters then its a different strategy and I would save it under a separate name (each with its own unique ID generated inside WLab) e.g. MyStrategy v1, MyStrategy v2, and so forth.
0
- ago
#3
The expectation here I think is that historically the SM has been working with its own copy of the strategy - here with the saved parameters.
0
- ago
#4
In older versions of WLab (v6.9 and prior) the SM always refreshed the strategy before running. I know this b/c whenever I made a change to the C# (C++ before that) code it was immediately reflected in the SM alerts. (I almost never used sliding parameters so can't say whether those changes would have carried over).
------------------------------------

Ideally, this should be fixed b/c we expect changes made to a strategy to be automatically carried over to all sections of WL8 - such as SM, MetaStrategy, etc. However, in lieu of automatic updates how about: Have a check box in the SM strategy's Configure window somewhere that says "Reload strategy afresh each time" (or something similar). If the box is checked then the strategy should be updated (it only takes an instant), if not then SM can use its own copy. I think this would be quite explicit, not cause false expectations and let the user choose the desired behavior.
0
- ago
#5
QUOTE:
Have a check box

Sure, checkboxes are so cheap to add and build a perfectly fugly GUI 😃
https://ifunny.co/picture/typical-apple-product-a-google-product-find-your-company-s-2wBCgH118
0
- ago
#6
There could be "Reload" option on the strategy's context menu in the strategy monitor. Hence, in the strategy monitor, right-click on a strategy and pick "Reload". For consistency, there could be a corresponding button at the top of the strategy monitor. The strategy would have to be not active to reload it. I don't know if "Reload" is the right word to use, because that could imply many things to many people.

As for me, I remove the strategy and re-add it, which is good enough.
0
- ago
#7
I created a test workspace (WS) with Strategy Monitor (SM). Created and added 2 strategies to the SM - one that used C# code w/o parameters, the other was also C# coded but in addition had sliding parameters. Here's what I found:

1) C# coded strategy:
Ran the strategy independently as well as inside the WS/SM... it gave its signals.
Modified and saved the strategy. Closed and restarted WLab... verified that strategy showed modified code (it did)... ran it independently as well as inside WS/SM... both showed new signals.
What this means: The SM automatically updates the C# code. This behavior is correct.

1) C# coded with sliding parameters strategy:
Repeated all steps above for C# strategy with parameters... changed some slider values and saved them. Closed and restarted WLab... verified that strategy showed modified code and parameter values (it did)... ran it independently as well as inside WS/SM... when run standalone it showed the new signals but inside the WS/SM it still showed the old signals. Opened the Configure option in SM... the sliders all had old (now obsolete) values.
What this means: We already know from test #1 above that the SM updates the C# code. However, it does not update the parameter values even though the modified code includes them. Clearly, the parameter values are being stored independently and don't get updated. And that's the bug IMHO.

Summary: When a strategy is updated in the SM it should be updated in its entirety including the parameter values, SM shouldn't be using old (now obsolete) parameter values.
0
Glitch8
 ( 10.41% )
- ago
#8
In your viewpoint it's a bug, in someone else's it's a feature. What about the people who might want to put multiple copies of a Strategy in the SM each with DIFFERENT sets of parameters? Your proposed "fix" would make that impossible.
1
- ago
#9
Personally, if the parameter values are radically different then the strategy is different and should be stored with a new name e.g. MyStrategy v1 (SMA 50), MyStrategy v2 (SMA 200), etc. and then added to the SM.

The best solution would be to have an option (check box) to Refresh Strategy in its entirely OR Keep original Parameter values. Meets everyone's needs.
0
Glitch8
 ( 10.41% )
- ago
#10
I obviously disagree. But I see no harm in adding a right click to reload a Strategy in the SM, we added it to the Enhancements list.
1
- ago
#11
Thanks.
0
- ago
#12
QUOTE:
I obviously disagree. But I see no harm in adding a right click to reload a Strategy in the SM, we added it to the Enhancements list.


You may have considered this, but in reloading a strategy, the code may have changed such that there is a different set of parameters (not just parameter values, but a different set of parameters). Hence, that should probably be detected and the settings dialog shown. To keep it simple, perhaps the settings dialog should always be shown on a reload. For a reload, I would always want the settings dialog shown so I could check my strategy settings.
0
- ago
#13
@Paul1986
QUOTE:
For a reload, I would always want the settings dialog shown so I could check my strategy settings.

Good point.
0
- ago
#14
@Glitch,
Has this been implemented?
0
Glitch8
 ( 10.41% )
- ago
#15
Not yet, no.
0
- ago
#16
@Glitch,
QUOTE:
... I see no harm in adding a right click to reload a Strategy in the SM, we added it to the Enhancements list.

Its been 4+ months.
Any plans to include this in your current drive to fix the backlog of issues/bugs with the program?
0
Glitch8
 ( 10.41% )
- ago
#17
Edit: I'm adding a right click so you can refresh strategies in the SM. Even though I don't consider it an issue/bug it's more of a preference that you can now achieve.
1
- ago
#18
Great, looking forward to it !!
0
- ago
#19
Using WL8 b50.

I refreshed a bunch of Weekly scale strategies to bring in any code changes but when I ran them immediately afterwards no signals were generated. Its only when I closed and restarted WL8 that signals were generated.
This behavior is non-intuitive.
Perhaps you can fix it so that the strategy can be used immediately after refresh w/o a restart being required?
If not, a note to that effect would be useful e.g. in the message box that appears after refresh, something like..."Save Workspace and restart the program for changes to take effect", etc.
0
Glitch8
 ( 10.41% )
- ago
#20
It should run immediately, let me take care of the issue for Build 51.
1
- ago
#21
Just noticed... I'd modified Max Open Position number and a Parameter's value in a strategy but even after refreshing the strategy (and saving the workspace and closing/restarting WL8) those changes did *not* carry over, had to edit those manually.
It was a weekly strategy (not sure if that makes any difference).
You may wish to verify on your PC.
0
Glitch8
 ( 10.41% )
- ago
#22
It's not supposed to be carried over, you configure the SM's Strategy Position Size right in the SM configuration.
0
- ago
#23
Talking about number of positions, not position size.
And also about Parameter value(s).
0
Glitch8
 ( 10.41% )
- ago
#24
The feature is really designed to pull in only code or logic changes, not any of the additional elements. Parameter values are configured at the SM anyway.

It even says in the menu "(bring in any code changes)".
0
- ago
#25
To refresh...
For a C#-coded strategy the C# code always got refreshed when a Workspace/Strategy Monitor or the app was closed and reopened.
The non-code elements such as are found in Strategy Settings were not getting refreshed hence this ticket was created. See post #s 1 & 7. Also see Post #12 by Paul.
I'm not sure what the point of "bring in any code changes" is when that was already happening automatically.

To summarize:
The idea is to refresh the strategy in its entirety (except position size which'll be carried over as set previously). And by doing this manually via right-click, as opposed to automatically, the user will do this knowingly so there won't be any surprises.
0
Glitch8
 ( 10.41% )
- ago
#26
The point was to allow you to refresh a strategy in the SM after making code changes in the editor/BB designer WITHOUT needing to close and reopen the SM or Workspace. Is it really that hard to understand?
0
- ago
#27
For a C# strategy with Parameters one really can't just update the code alone.
As an example, say a user added a strategy to the SM with 5 parameters... over time the strategy was tweaked - 3 params were removed, 5 were added and their order in the code was rearranged - and now you have 7 params with the original 2 not even in the same order. If only the C# code was updated w/o the params then one has a broken strategy that would either not run or give "unexpected" results.

I request that the Parameters also be updated when the code is updated - all other settings can remain the same (# and size of positions, etc. - the user can tweak them) - as they're inextricably linked to the code itself.
1
Glitch8
 ( 10.41% )
- ago
#28
I can see your point there, we'll make sure the parameters are updated too when you click the Refresh menu.
2
- ago
#29
👍
0
- ago
#30
@Glitch can you please expand on your current thinking about the implementation of how settings will be saved to strategy in SM? Currently, the start-up settings for parameters default to the default value in code, regardless of how they are set when strategy is open standalone or saved. Also, these parameter settings can be modified from their defaults when adding the strategy to the SM.

Also, the settings for strategies running in the SM are controlled by the workspace settings, not the standalone strategy that has been saved. It's common for me to run different strategy settings in the SM than in standalone mode, when I am C# developing or testing. I would not want the SM strategy / Workspace settings to revert to the standalone / saved strategy parameter settings by default. OF course, @Sammy_G makes a good point about the potential conflict if development includes adding new parameters. Should we be thinking about some "Overwrite Options" here to handle different objectives?

Also, setting up a strategy in the SM has some unique requirements. For example, you must pick a DataSet (if not running single symbol); it will not default to the DataSet saved with the strategy (not sure why). Further, the SM installation requires setting Broker and Streaming settings (for intraday data). I'm not clear how all of these going to work together with this new functionality and how many save options might be required to insure a desired result.

I don't have a complete understanding of how all these pieces might work together across different use cases but I'm confident you do. However, I wanted to raise this issue as I am wondering if there may be more complexity to the specification of this feature than discussed here.
2
- ago
#31
Using b51.

Upon refreshing the strategy in a saved SM the changes are immediate (no app restart required)... any additions/deletions/rearranging of the parameters are also carried over... old position sizing & symbol/dataset choices are retained...many thanks!

However, changes to the default values of parameters are not carried over. Was that intentional so that the user can decide whether to use the (retained) old values or replace with the new ones manually?
0
Glitch8
 ( 10.41% )
- ago
#32
Yes, we didn't want to overwrite any values someone might have already established in the SM settings.
1
- ago
#33
OK.
--------------

It would be awfully nice if the same ability to refresh the code + parameters, possibly with an option to update Parameter default values as well, was also available inside a MetaStrategy. That way one could update "in-place" without having to remove and re-add (one or more) strategy and lose all extra settings (position sizing, portfolio weight, dataset, and so on) and also lose its place in the strategy hierarchy.
0
- ago
#34
I played around with a MetaStrategy (MS) with multiple strategies, here's what I found:
- Strategies inside a MS get refreshed automatically when its opened
- If a strategy has Parameters here's what's happening: Adding or Deleting params in parent strategy gets reflected in the strategy inside MS also; however, if the params get rearranged in the parent they *only* acquire their new sequence if there was also a param addition or deletion, not otherwise.
This can potentially create confusion especially when one lines up the params in MS against the parent strategy and tries to match them (values don't get updated automatically); a user can be excused for thinking they'll be in the same sequence. To avoid such potential confusion I request that when the strategies are refreshed inside a MS it should always include the listing order of the Parameters also. It's a simple but important fix.
0
- ago
#35
@Glitch - I've been using the new Refresh.... feature and it's super helpful for development. Works as advertised! Thanks.
1

Reply

Bookmark

Sort