RunDonor(Strategy) wont work for strategies that utilize MySql connection
Author: aykuts
Creation Date: 4/10/2014 6:00 AM
profile picture

aykuts

#1
Hi,

I have included into my strategy a section whereby the state of certain parameters (i.e. the value of the parameter at each bar while looping) are logged into one MySql table using a MySql connection.

- This strategy was successfully called via "LoadFromDisk" and "RunDonor(Strategy)" method (as explicitly described and defined in
http://www2.wealth-lab.com/WL5WIKI/Default.aspx?Page=kbInteractingWithPortfolioEquity ) before I included that code section into the strategy that handles this connection and inserts into one table some relevant values.
i.e.
1) The strategy itself is compiled successfully,
2) And, some other (caller) strategy ran well and returned correct values once it is executed.

- This very same strategy however cannot be called programmatically with that method after I included the code section that connects to one MySql db and logs certain information.
i.e.
1) The strategy itself works fine, it is compiled successfully, and operates fine when it is "clicked on",
2) However, the editor returns " cannot compile" error if this very same strategy is called programmatically by another caller code.


One question would be, why I am using this kind of "specialized performance logging": The reason I use this logging is that; I can easily get the performance results of any strategy (whether or not it is called programmatically) whereas I needed some sort of an additional logging mechanism to see/check/graph/analyse the trends/performance of certain "strategy-specific private" variables
e.g. logging the level of neural network throughout the data range to observe its state at the time it signaled a successful trade,
e.g. observing the state of a certain private bool flag variable at the time the strategy recorded its highest loss, etc.

**

My question is that; how should I modify the community component class to make this "loadfromdisk+rundonor" method to work fine for the strategies that have references to MySql?

My hunch is that, if I can add reference to the community class, the caller strategy will be able to compile these kind of "mysql-included" strategies, and that way, I will be able to call, programmatically, the strategies with MySql references.

Or, if that is not the remedy, anything you might suggest?

Thanks in advance for the time and consideration,

Aykut Saribiyik
profile picture

Eugene

#2
Hi Aykut,

Let's start with the essential thing: what exact error message is returned by the Editor when it stops with a "cannot compile" error.

P.S. You added a reference to System.Core, did you?
profile picture

aykuts

#3
Hi Eugene,

Sorry for my poor description of the situation.

1. System.Core is referenced (after your remarks to one of my questions a couple of weeks ago)

2. The caller strategy (that calls the strategy via RunDonor) is attached to this post (just in case you would like to have a look at)

3. The donor strategy,
- which is compiled successfully and returns correct values once it is called directly ,
- whereas returns error when it is called via the caller strategy,
is also attached to the post.

4. The full text of the error message (as far as I could see on the debug log) : "Error processing symbol GARAN_TI_EQUITY Error compiling garan_long"

Thanks.

profile picture

Eugene

#4
I haven't experienced it before and the use of MySQL makes it very complicated for me to reproduce this. How about creating a class library with your Strategies in Visual Studio (as opposed to using the Wealth-Lab's built-in Strategy Editor)? I think this workaround might make the error disappear.
profile picture

aykuts

#5
ok. I will try that as well.

Thanks, best regards

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