Trading System not producing trades after moving to new PC
Author: mikesblack
Creation Date: 2/27/2018 12:29 PM
profile picture

mikesblack

#1
Greetings,
I have moved the following system to a new computer. For some reason it is not producing trades. Can you help me out?
CODE:
Please log in to see this code.
profile picture

Cone

#2
Can't help you troubleshoot without your SSLib, but for sure it has something to do with the multi-entry "condition" never being true. Why don't you try breaking that down into separate conditions and then start combining them. That way you'll see which one is breaking it for you.
profile picture

mikesblack

#3
Also I am getting this:
Error processing symbol ZTS Object reference not set to an instance of an object.
profile picture

Eugene

#4
Hi Mike,

This strategy contains numerous references to external libraries (supposedly developed by 3rd party). Respective assembly may be absent from the Wealth-Lab Pro main folder and/or the Strategy References... dialog (if it resides elsewhere). Most likely you've overlooked copying it to the new PC.

Also, you should examine the Editor compile and error messages frame for any compile errors - this should give you enough clues. When you fix all compile error the strategy may start producing results.

QUOTE:
Also I am getting this:
Error processing symbol ZTS Object reference not set to an instance of an object.

Can't believe you won't find it in the Wiki at Errors | Strategy - it's been there for years.
profile picture

mikesblack

#5
When I select Compile I am not getting any results.
profile picture

Eugene

#6
What "results" do you expect the compiler to return? You should be looking at the compiler messages. Can you be more precise about what happens?
profile picture

mikesblack

#7
Thanks Cone,
SSLib is installed. Will try as you suggested.
Thanks Eugene.
profile picture

mikesblack

#8
Eugene, I am expecting to see errors in my code. The window is empty.
profile picture

Eugene

#9
P.S. In addition to Cone's suggestion "for all time", I'd debug a long code like this in Visual Studio as described here:

How can I debug my trading strategies in Wealth-Lab?

My objective would be to evaluate the state of variables all at once bar by bar:

Autos and Locals Windows @ MSDN

QUOTE:
Eugene, I am expecting to see errors in my code. The window is empty.

The frame at the bottom, and not the Debug window - as I was not talking about it - is never empty when you click Compile. Since we've determined that you have Steve Salemy's "SSLib" in place the Strategy should compile. Does it?
profile picture

mikesblack

#10
Nothing in the window at the bottom. I assume it is not compiling.
profile picture

Eugene

#11
There is. You are probably not seeing it due to Windows display settings. See (146) Application needs to support 120 DPI throughout in Open Issues:
QUOTE:
Selecting the "Medium - 125%" option in Display (Windows Control Panel) causes some overlay and/or partial invisibility in various tools like Strategy Parameter box, compiler error message box, and many other parts of the interface.

Especially considering this is a new computer.
profile picture

mikesblack

#12
Thanks Eugene,
The system compiles successfully. Now I'm not sure what my next step is.
Appreciate yours and Cone's help with this.
profile picture

Eugene

#13
If you can't use Visual Studio for debugging, follow Cone's suggestion and break down your long code into small parts. Concentrate on one section, examine the PrintDebug output of variables and conditions, plot some DataSeries etc. Look for 'unexpected' values. Proceed until you find what's not working in your code as expected. It's up to you.
profile picture

mikesblack

#14
Eugene,
I'm sorry but I just don't know how to proceed at this point. I'll trade on my first computer for now and get some help from Yuri. Sorry I'm so daft with this. Hope to improve my skills in time with Yuri's tutorials.
Thanks again for your help.
profile picture

Eugene

#15
Mike, I think you're making it more complicate than it is. If you like us to get somewhere with this consider sharing more details than something like this:
QUOTE:
For some reason it is not producing trades.

A good problem report should contain enough information for technicians:

1. Strategy code Got it (to some extent - minus the DLL)
2. Wealth-Lab tool in use (Strategy Window / Monitor ?)
3. Data Loading settings !
4. Symbol(s) and Data provider
5. Single symbol or Multi-symbol mode?
profile picture

mikesblack

#16
Thanks Eugene. I'll keep your suggestion in mind. Working with Yuri. He found out that my SSLib Dll was written for a prior version of Wealth Lab. At this point my system won't recognize a portfolio. I have a meeting with Yuri later and hope to resolve this.
profile picture

Eugene

#17
QUOTE:
He found out that my SSLib Dll was written for a prior version of Wealth Lab.

If the Strategy compiles (as you said) and it keeps on working on your other PC then Steve's DLL may not be the reason. Unless there was a breaking change in an interface they're using (and it's been a while since one happened in the WL5/6 history), "legacy" libraries (compiled for .NET 4 or even 2) keep on functioning in general.
profile picture

mikesblack

#18
Thanks.

I am still getting "object reference not set to an instance of an object" while using my desktop( Win 10 64 bit) WL 6.9. S and P 500 data 5 years pos size 6%. Compiles ok. Do you have any other suggestions?
profile picture

Eugene

#19
Re: suggestions, they are in post #4 above.
profile picture

mikesblack

#20
Checked Wiki. Couldn’t find what I was looking for.
I have a system that produces no errors and so I cut and pasted most of the code to the new system. I’m still the same results. Strange it should work on one computer, windows 7 but not on windows 10. I wish not to burden you more with this unless you have some ideas.
profile picture

Eugene

#21
QUOTE:
Checked Wiki. Couldn't find what I was looking for.

You couldn't find "Object reference not set to an instance of an object" at the bottom of this page: Errors | Strategy?
profile picture

mikesblack

#22
I found that, but couldn’t apply it ti this issue.
profile picture

Eugene

#23
Mike, I'm getting increasingly frustrated by this style of communication:

"The system compiles successfully." - Having been affected by the QC 146 issue at that time, I wonder how could one know that without seeing the compiler output hidden by the "distorted rendering".

"and so I cut and pasted most of the code to the new system" - Which creates some new unknown code. (At least this doesn't really matter since technicians cannot compile the code w/o the 3rd party libraries and it's not our duty to troubleshoot custom code.)

"couldn’t apply it ti this issue." - Cited Wiki section contains 4 directions to work around the issue. What exactly have you tried, step by step?

Until you indicate which steps have been taken to alleviate the problem I'm in the dark about further troubleshooting suggestions.
profile picture

mikesblack

#24
Eugene,
I will try to format my questions and explanations as you have suggested.
I’m off to ski climb Mt Hood today and so will re organize my question either today when I get back or tomorrow as I expect to be exhausted after today’s climb.
Thanks for your feedback and my apologies for the vague explanation.
Hope you have a great day and weekend.
profile picture

mikesblack

#25
QUOTE:
"The system compiles successfully." - Having been affected by the QC 146 issue at that time, I wonder how could one know that without seeing the compiler output hidden by the "distorted rendering".

. After adjusting the screen format I an now able to see the compile window. The strategy in question compiles.
QUOTE:
"and so I cut and pasted most of the code to the new system" - Which creates some new unknown code. (At least this doesn't really matter since technicians cannot compile the code w/o the 3rd party libraries and it's not our duty to troubleshoot custom code.)

. I understand. The only library that is not from Wealth Lab is SSLib. I'm not entirely sure this is the issue as it is installed on systems that work..
QUOTE:
"couldn’t apply it ti this issue." - Cited Wiki section contains 4 directions to work around the issue. What exactly have you tried, step by step?

.
QUOTE:
Note: this is a pretty multifaceted error message - it can happen outside of a Strategy. But should you experience the run-time error in your Strategy telling you that "Object reference not set to an instance of an object", you need to know that there's a variable that has not been initialized, in other words it's null. Either you haven't assigned a value to some variable, or a method/function that you called has set the variable to null.

If "Benchmark Buy & Hold" symbol is defined and enabled in the Wealth-Lab's Preferences dialog, Backtest Settings, you need to make sure that the symbol name is valid and could be found in your DataSets. Entering a symbol that does not exist or has no data is a popular reason for getting this error message in backtests.

If it occurs on some particular symbol, it is also possible that a drawing object for that symbol and bar scale has got corrupt. To fix, click the Eraser button atop the Drawing Objects toolbar ("Clear Drawing Objects"). If this doesn't work then try reloading data (right click on the chart and select "Reload Chart History").

If the message reads "Object reference not set to an instance of an object. Unable to get Data on Demand for symbol: XXXX", uncheck "Update Data on Demand" in the Data Manager.

. Item One: All variables initialized and not set to null. Methods/Function not set to null. All variables assigned a value.
.Item Two: All symbols(S and P 500) are valid.
.Item Three: Not applicable.
.Item Four: Unchecked "update data on demand".

In addition, I went through each rule for buys and marked each with a double slash mark. That didn't change the outcome.

Would you accept me posting both the system that produces trades and the one that does not? Perhaps there is something obvious you can see.
profile picture

Eugene

#26
QUOTE:
Would you accept me posting both the system that produces trades and the one that does not? Perhaps there is something obvious you can see.

Isn't the one that does not contained in post #1? So we need to have a look at the working code, right? Don't forget to enclose the DLL(s) required to run the code.

QUOTE:
. Item One: All variables initialized and not set to null. Methods/Function not set to null. All variables assigned a value.

It's trickier than just initialization. Like the Wiki says, Either you haven't assigned a value to some variable, or a method/function that you called has set the variable to null. The idea is to debug your system the way you prefer - with PrintDebug() or Data Window or even Visual Studio (for developers) to visualize the values on a bar by bar basis.

QUOTE:
.Item Two: All symbols(S and P 500) are valid.

It's about the Benchmark B&H symbol. If it's enabled in Preferences, has its validity been checked?

Anyway, I think that this "Object reference not set..." message may be caused by including a symbol with shorter history in the index.
profile picture

mikesblack

#27
Ok, I just cut and pasted the code from the system that is not working to the system that is. Buy and sell signals. That worked.
Please disregard this issue. Thank you for all of your help.
profile picture

Eugene

#28
Sometimes issues like this can happen when a drag and dropped indicator no longer exists or due to another quirk of Strategy's XML file. So copying code into a new window may work. You had all the keys to it so I'm glad you've solved it on your own.
profile picture

mikesblack

#29
I discovered what the issue was. My laptop was accessing an external symbol (.SPX) from "Indices" when it should have been "INDEXES !!". Simple, but had me scratching my head for a long time.
profile picture

Eugene

#30
Based on your experience let's expand our FAQ then this way:

QUOTE:
If "Benchmark Buy & Hold" symbol is defined and enabled in the Wealth-Lab's Preferences dialog > Backtest Settings, or your system uses an external symbol's data, you need to make sure that the symbol name (or DataSet name) is valid and could be found in your DataSets. Entering a symbol that does not exist or has no data is a popular reason for getting this error message in backtests.
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).