Need Ideas

S

Stephen Lynch

I need a few ideas on where to start. I am developing a module that will
rebalance investment accounts. For example, my table shows the following:


AcctNo Symbol Balance PercentofAccount
111211 MASEE 10,000 .100
111211 JANSX 10,000 .245
111211 PEOPX 10,000 .205
111211 BMNAX 10,000 .405
111211 SWPEX 10,000 .055


I have another table that lists the target percentages like such:

AcctNo Symbol TargetPercent
111211 MASEE .250
111211 JANSX .250
111211 KTWEX .250
111211 POTFX .250


I need to outcome to be like:

AcctNo Symbol Balance CPercent TPercent Trans
111211 MASEE 10,000 .100 .25 Buy
15,000
111211 JANSX 10,000 .245 etc
111211 PEOPX 10,000 .205 0 Sell
all
111211 BMNAX 10,000 .405 etc.
111211 SWPEX 10,000 .055

So what is the best way to start with this? Do I store the symbols and
percents in memory and then loop through? The only problem is that there is
not a set number of symbols.

I have done this before through about 10 different queries but now I want to
make it clean using code.

Ideas please to get me started.

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top