kazuna8
 ( 42.83% )
- ago
I have a daily scale strategy activated in the Strategy Monitor.
The strategy used to have 4 strategy parameters when it was activated in the Strategy Monitor.

Once I updated the C# code to add new 2 strategy parameters, the scheduled strategy started to fail with the following error in the status.
QUOTE:
2024/09/30 13:42:32: Exception running Strategy on : Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')


Restarting WL8 didn't fix the problem, so I inspected the strategy setting and found only 4 strategy parameters listed which is odd because the code has 6 strategy parameters.

So I deactivated and removed the strategy from the Strategy Monitor.
I added it back to activate it again.

Now I see 6 strategy parameters listed in the strategy setting and the problem went away.
0
199
6 Replies

Reply

Bookmark

Sort
Cone8
 ( 5.57% )
- ago
#1
Not allowing a bug report for an induced error.

If you change the strategy, deactivate it and click "Refresh selected strategies..." for the SM to use the updated code.
0
kazuna8
 ( 42.83% )
- ago
#2
Fair enough.

Fortunately, today is not the day for my strategy to generate a signal and I now understand how to deal with it, I have no problem.

I just wanted to report the issue because other people may run into the problem.
0
Cone8
 ( 5.57% )
- ago
#3
QUOTE:
Restarting WL8 didn't fix the problem,
After re-reading, I'm going to see if I can make that happen because a restart and loading the workspace should have used the updated strategy. I don't know how it could be otherwise.
0
Cone8
 ( 5.57% )
- ago
#4
Yah, I can't make that happen even trying. There's nothing about this report that makes sense to me. Even if the Strategy running in SM was somehow recompiled to be aware of new Parameters (the only way I know of is by deactivating and hitting the Refresh), it wouldn't have affected the parameter indices of the original.

It's 100% more likely that the original strategy was affected by a new position (or something dynamic like that) that happened at run time.
0

Reply

Bookmark

Sort