No way to add a Reference to my Strategy in Visual Studio
Author: johnls101
Creation Date: 1/27/2019 1:15 AM
profile picture

johnls101

#1
I have been trying to run the code “Probability - Probably a Good Thing to Know (Ehlers)” from TASC 2018-10 but have had problems adding the reference.

I have loaded Visual Studio Community 2017 and selected the saved code in the Solution Explorer (Folder View), but there is apparently no way to select “Reference” or “Add a reference” within this.

Right clicking the Solution Explorer at the top reveals a drop down menu in relation to the display of Solution Explorer. Right clicking the saved code after loading it into Solution Explorer reveals a drop down menu that includes “Add” with its own drop down menu. Under “Add”, there is then another drop down menu with “Add New Item” (as well as New File and New Folder). Under “Add item” there is a window entitled “New File” with options including installed and online options. However, none of these options include the ability to add a reference.

I have also tried right clicking “Project” at the top, but “reference” and “add reference” are not available.

I have been through the suggestions posted by various people on Youtube, Stackoverflow and Microsoft, but am going nowhere.

Does anyone have suggestions as to what I am doing wrong and how I might fix it?
profile picture

Eugene

#2
I'm not at all sure why you're going the hard way. The Wiki code for S&C articles merely accompanies our Traders' Tips but you can always download it to Wealth-Lab where it'd run instantly. Let's make sure it works in Wealth-Lab at first:

1. Strike Ctrl-O
2. Click "Download"
3. Check "Download public strategies" but uncheck "Published since"
4. "Begin download", wait until succeeded
5. From "Utilities" folder, open the downloaded Strategy.

Does its output look like in the Wiki article?

QUOTE:
However, none of these options include the ability to add a reference.

Been there, done that. The lost 'References' hive in a VS project is similar to the experience one gets if he tries to open a project from Github directly, without cloning a repo to the computer first.

I have no idea what's wrong with the solution that you created from scratch in VS but I took the trouble to create a new project with the "Probability..." strategy for you. It's preconfigured for 64-bit Wealth-Lab Developer users with TASCIndicators installed. I've double checked that it has all references required and compiles correctly. It should also be ready for debugging in WLD. See attachment.

If you installed WLD to a non-default directory, update the references for WealthLab.dll and TASCIndicators.dll to your custom location. (Same for curious WLP users who stumble onto this thread as the code won't compile for them out of the box).
profile picture

johnls101

#3
Thanks for that Eugene. I appreciate your input a lot.

I had previously copied and pasted the code from the Traders Tips which did not work. However, I simply downloaded the strategy as you suggested in #2 and it worked fine. It looked fairly similar to the Wiki article except that with my screen size and resolution, the graph was pushed over to the far right and was mostly obscured.

I have been trying (unsuccessfully) to find a way of positioning the graph at the left hand side of the chart so that I can see the most recent price data at the right. I would also like to position a second chart above the first so as to link up average price shift with the probabilities. I am also potentially interested in plotting a 3-D graph if this is possible.

I would greatly appreciate your suggestions with these.
profile picture

Eugene

#4
You're welcome.

QUOTE:
I had previously copied and pasted the code from the Traders Tips which did not work

Probably because of the missing reference to System.Windows.Forms.DataVisualization.dll.

QUOTE:
I have been trying (unsuccessfully) to find a way of positioning the graph at the left hand side of the chart so that I can see the most recent price data at the right. I would also like to position a second chart above the first so as to link up average price shift with the probabilities. I am also potentially interested in plotting a 3-D graph if this is possible.

Anything is possible if you learn Microsoft's Chart Control. There are countless resources on how to use it. Just a couple of first hits:

https://code.msdn.microsoft.com/Samples-Environments-for-b01e9c61
http://csharpexamples.com/c-chart-control-example/
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).