Link to home
Avatar of Ted Penner
Ted PennerFlag for United States of America

asked on

Code clean

Hats off to Dave for all the assistance with this. What we have now is amazing!

I am looking to clean up the code used in the v5 workbook here a little  I would prefer to have as many one or two line descriptors to state the purpose of each major block of code as needed, and have appropriate names in the modules "if" more than one module is required. Ideally, I'd like to have only one module to reference all the code but if there are some technical reasons why this isn't possible, then that is OK. The bottom line is that I would like to be able to tell what each section of code does, a little easier than I can currently.

Note that it is also no longer necessary to remove any columns during the import function. The following columns should all be shown depending on their availability in the following two types of exports, and should not have been coded to be removed. The section of code that removes the columns, can be deleted:

Live Trading Export – Trade History Columns
Exec Time | Spread | Side | Qty | Symbol | Exp | Strike | Type | Price | Net Price | Order Type

Paper Money Export - Trade History Columns
Order ID | Exec Time | Spread | Side | Pos Effect | Qty | Symbol | Exp | Strike| Net Price | Order Type

Thank you sir!
Avatar of dlmille
Flag of United States of America image

There aren't enough lines to require having more than one module.  However, for debugging purposes and general understanding, grouping subroutines and functions under a common, related module is a better practice than lumping all the routines in one module.

As a result, I've named the modules, after adding documentation to the code - at the top and inside the code, to ease debugging that may be required in future.

The columns you have been documented are allowed entry into the sheet, and logic has been added to select the appropriate columns in the InsertPostion based on selection code, re: checking/unchecking trades that make up a position.

See attached.

Avatar of Ted Penner


Fantastic!  We missed one column and some adjustment to ease view-ability needs to be made.  Here is a video on what I noticed  I am forming the column documentation now on what needs to be moved over. It should be relatively straight forward and will be posted in a subsequent question.
Avatar of dlmille
Flag of United States of America image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial