Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to get back into what I once loved - building solutions to a need. It's been a very long time; my last copy of Visual Studio was 2008. I think my first was Visual C 1.42. I just installed VS2022, and there's virtually nothing there I recognize.

Here's my challenge. I'm an investor, mainly because I turned 67 today and nobody's going to hire an old engineer. I use a great product to help select and manage trades, and it's given me returns around 65% this year. The problem is tracking. It's great at tracking Stocks, but has nothing to keep track of Options, and Options are far more profitable!

After much thought, over a year or so, I've realized that what I want to track is Positions. Traders and investors open and close positions, and those positions can be stocks, options, or a combination of both. I'm out to create a desktop application that can keep track of an investor's positions, and generate reports that help to determine a number of important results, like win%, max account drawdown, that sort of thing.

What I'm visualizing is a SQLServer-based stand-alone application that holds records of positions that an individual can analyze in various ways to compare the performance of different strategies and systems over time. I want to make it something that I can use, and can also freely distribute to others in my investing community, without a need for a website.

My approach to this sort of problem is to imagine every possible class I might need: My first attack resulted in a need for a Stock, a Call, a Put, a Position. Fair enough. But the only difference between a Call and a Put is a Type, so I can replace the two classes with one, with a Type attribute. Stocks and Options have something in common, too. Stocks have a Symbol, and all Options have an underlying Stock, which has a Symbol. Would that be a good candidate for an index?

My first pass at design left me with a BuyPrice and a SellPrice, which both Stocks and Options have in common. Since both change constantly, and I'm only interested in the price at the moment the trade is done, wouldn't it make more sense to elevate those fields to the Position class? The Position is what I want to record in the database - the others are just building blocks to facilitate implementing forms to record them.

As for the database implementation, I have in mind three tables to start. Stock records and Option records will have a different format. I plan to use two tables for that information, since I suck at creating and using variable records. The Position table will contain only references to the other two tables.

I've asked several general questions, and I look forward to the sense of the community for guidance. When it comes to connecting this app to an actual database, I'm going to need a lot of help; I've never been successful in doing that. I just hope that I'm heading in the right direction at this point.

OT - If you are a young, smart developer, please don't fail to create a future for yourself. I didn't, and now in retirement, I'm paying for it. Take at least 10 - 15% of your gross income and invest it. If you can do it with an automatic deduction, you will never notice it. Learn to invest intelligently - every legitimate brokerage these days offers a bunch of free training on YouTube. Use it, please! Don't spend your Golden Years, nibbling on Little Friskies.

Thank you all, in advance, for your excellent guidance. I can assure you that there will be many more posts, each more desperate (I hope not ), to entertain you. I'm looking forward to the adventure...

What I have tried:

So far, I've tried opening Visual Studio, which scared the hell out of me. There's absolutely nothing there I recognize, or know how to use!
Posted
Updated 29-Dec-21 23:15pm

Quote:
So far, I've tried opening Visual Studio, which scared the hell out of me. There's absolutely nothing there I recognize, or know how to use!

Yeah, it can look daunting when you first try - it's not designed for "unattended beginners" to double click and go.
The first thing you need is a Solution, which contains one or more Projects. Each project produces an Assembly which can be executable or not. Your project will want at least one executable project.

Now for the fun bit ... what type of executable project do you want to create? There are three "basic types" of EXE file you can produce with C#: Console, WinForms, and WPF - and those are in increasing degree of complication. (But ... there are also UWP, Website, and Xamarin projects but ignore those for now).

If you want to present information in a digestible way then I'd suggest a WinForms app as your best starter - if you know C#, then that's the simplest way to a Windows app with a GUI. But ... if all you know is C# the language, then there is a massive learning curve heading your way even for WinForms as there are a huge number of classes (including displayable Controls) which you need to be aware and understand.

What I'd suggest is grabbing a book - Addison Wesley, Wrox, and MS Press all do good ones - and working your way through it. That'll get you started with Solutions and Projects, and introduce the Controls and DataSources you will need, as well as explaining how to use them - it's far too big a subject for a little text box like this!

Good luck - there is a lot to learn, but it's all pretty consistent so if you have a development background it should be relatively easy to pick up.
 
Share this answer
 
Comments
Roger Wright 30-Dec-21 8:26am    
Thanks, Griff! I'm not new to this, or to C#, but it's been a very long time. Oddly, the 4 shelf bookcase that was solid programming books 10+ years ago is now populated by structural design, civil engineering, and gunsmithing books. Things change. Off to Amazon!
I'm here to second what OriginalGriff said. You're biting off a whole lot to chew all at once here. You've got a learning curve to get over, and books can help.

Mostly I'm putting this here to add:

If you *do* want to play with the databases you have using Visual Studio, you can, and it works a lot like SQL Enterprise Manager used to in terms of it will allow you to edit tables, stored procedures, and the like and it will generate and possibly scripts to do the thing you asked of it.

If you go to View|Sql Server Object Explorer, it should appear to your left, if it hasn't already. You may have to add a server before it will show you anything.

Anyway, that may or may not help you. I now use this in lieu of tools like SQL Query Analyzer and SQL Enterprise Manager. Frankly, I think everyone does? So just FYI.
 
Share this answer
 
v2
Comments
Roger Wright 30-Dec-21 8:34am    
Hehehe... That's the only way to do it, jump in both feet first! The learning curve is sharp; it always has been with MS tools. Once upon a time they provided documentation - remember Scribble? Thanks for the suggestion about the database. That will be very helpful. I will no doubt have many questions later, as the last thing I used VS for was to write a visual designer for water pipes and channels to help me do the engineering for a water and sewer company in 2008 or so. Thanks!
Just to add a word of warning in addition to the other solutions ... and I'm surprised @Originalgriff didn't say this - he usually does! :laugh: ...

The fastest route is the straight path of a good book (or course), and doing the exercises. So stay well away from books like
"... for Dummies" (although they can be the best of a bad bunch),
"... in XX days"
"... in XX hours"
"Learn .... fast" etc etc

The shortcut-style of books will do more damage than good - I speak from experience unfortunately.
 
Share this answer
 
Comments
Roger Wright 30-Dec-21 8:40am    
I know what you mean! I still have some of those shortcut books from the '90s. Yes, you could write a Hello World program in 21 days, but not much else. On the other hand, a lot of the more technical books are useless, as well. I still have the entire set for the MS Foundation Classes around here somewhere, along with 60 -100 older and now useless programming and networking books. What do you do with them when they become obsolete?
CHill60 30-Dec-21 9:24am    
"What do you do with them when they become obsolete?" I use the box-set of C++ manuals from the 90's as a doorstop. Really. :-)
OriginalGriff 30-Dec-21 15:27pm    
I sent mine to the tip for paper recycling ... too heavy to sell on Fleabay, too specific to give away locally.
Sad day ... but I needed the space.
Roger Wright 30-Dec-21 17:38pm    
It is sad... I've still got VC++ 1.42, along with docs, and a copy of TurboPascal 5.5+ with books! Time for them to go!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900