PortfolioXpert:Query
From VPM Partners Wiki
Contents |
Building a New Query
To build a new query:
- Click
from the Queries view (screenshot) to open the query wizard. Or click File from the Main Menu Bar and select New Query (screenshot).
- Enter a name for the query (screenshot).
- Add a query rule:
- Click
to add a new rule (screenshot).
- Apply a Trade System to the rule (screenshot).
- Select a rule Parameter (screenshot).
- Select a rule Operator (screenshot).
- Enter a rule Value (screenshot).
Be sure to use the correct format (e.g. YYYY-MM-DDDraw Down for dates, 0.15 for 15%) or the rule will not be valid. Refer to the Rules Table below for the correct formats.
- Click
- Click the Delete column of the rule to be removed to select it (screenshot).
- Click
to remove the selected rule (screenshot).
- Click the Yes button to confirm removal of the selected rule (screenshot).
- Select how the rules are used by choosing to only return results that Match All of the Following Rules or to return results that Match Any of the Following Rules (screenshot).
- Click the Next button (screenshot).
- Select which securities in the database to search by choosing either Search Entire Database or Limit Search (screenshot). If choosing to
limit the search, you will need to:
- Enter ticker symbols for securities to include in the search into the entry box separated by spaces or commas — not a combination of BOTH (screenshot). Or copy/paste ticker symbols from a spreadsheet (screenshot).
- Click the Add Symbols button (screenshot).
- Symbols found in the database will appear in the Limit Search Symbols table. Symbols not found in the database will remain in the entry box (screenshot).
To remove a Limit Search Symbol:
- Click the Delete column of the symbol to be removed to select it or click the Select All Symbols button (screenshot).
- Click
to remove the selected symbol (screenshot).
- Click the Yes button to confirm removal of the selected symbol (screenshot).
- Click the Finish button to save the query (screenshot).
Build Your Query wizard page:
To disable a query rule, click the in the Enabled column to change it to
(screenshot) or to completely remove a query rule:
Limit Symbols to Query wizard page:
Editing a Query
To edit a query:
- Click Edit from the Main Menu Bar and select Query (screenshot) to open the query edit wizard. Or right mouse click a query and select Edit Query (screenshot).
- Select a query to edit and then click the Next button (screenshot).
- Refer to the Building a New Query section for the remaining steps.
Deleting a Query
To delete a query:
- Select a query from the Queries view (screenshot).
- Click
to remove the selected query (screenshot).
- Click the Yes button to confirm removal of the selected query (screenshot).
OR
- Right mouse click a query and select Delete Queries (screenshot).
- Click the Yes button to confirm removal of the selected query (screenshot).
Once a query has been deleted it cannot be restored.
Running a Query
To manaually run a query:
- Right mouse click a query and select Run Queries Now (screenshot).
- Click the OK button (screenshot).
Rules Table
Rule Parameter | Rule Parameter Description | Usable Operators | Rule Value |
---|---|---|---|
% Losers | The percentage of losing trades for a security using the indicated trading system/model as compared to the Total Trades. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal percentage where 15% is input as .15 |
% Winners | The percentage of winning trades for a security using the indicated trading system/model as compared to the Total Trades. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal percentage where between 50-75% is input as .5,.75 |
Ave Loss % | The average percentage loss on all losing trades for a security using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal percentage where 13.94% is input as .1394 |
Ave Win % | The average percentage gain on all winning trades for a security using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal percentage where 123.31% is input as 1.2331 |
Average Drawdown % | The average percentage decline for all trades in a security from each trade’s peak level to each trade’s low using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal percentage where 5% is input as .05 |
Average WL Ratio | The amount of gains made for every dollar lost for a security using the indicated trading system/model (calculated by dividing the Ave Win % by the Ave Loss %). | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal ratio where a ratio of 3.163 is input as 3.163 |
Current Duration | The number of days a security has been held long in the current trade using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | positive integer representing calendar days |
Current PL | Percentage profit or loss experienced by a security in the current trade using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal percentage where 184.129% is input as 1.84129 |
Current Position | The current position of a security in VPMVirtual Portfolio Manager using the indicated trading system/model (e.g. Long or Flat). | Not Equal, Contains, Doesn't contain | flat, hold, sell_order, buy_order |
Drawdown High Date | The date the current or most recent trade in a security hit a high point using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | date value input using YYYY-MM-DDDraw Down format |
ER Ratio (Effectiveness Ratio) | Illustrates how well VPMVirtual Portfolio Manager has traded a security historically using the indicated trading system/model (calculated by multiplying % Winners by Average WL Ratio). | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal ratio where a ratio of 189.783 is input as 189.783 |
Entry Date | The date the indicated trading system/model purchased a security for the current trade. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | date value input using YYYY-MM-DDDraw Down format |
Entry Price | The assumed price the indicated trading system/model purchased a security for the current trade. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal number representing dollar value where $24.51 is input as 24.51 |
Last Close | The previous trading day’s closing price for a security. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal number representing dollar value where $69.64 is input as 69.64 |
Last High | The highest intra-day price for a security during the previous trading day. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal number representing dollar value where $75.45 is input as 75.45 |
Last Low | The lowest intra-day price for a security during the previous trading day. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal number representing dollar value where $69.36 is input as 69.36 |
Last Open | The previous trading day’s opening price for a security. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal number representing dollar value where $74.90 is input as 74.90 |
Losing Trades | The number of trades, as defined by a buy and subsequent sell, that resulted in negative returns for a security using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | positive integer representing individual trades |
Max Days Date | The date when the current trade is likely to meet the Max Days Held value. It is estimated using the maximum holding period for any trade in a security throughout its history. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | date value input using YYYY-MM-DDDraw Down format |
Max Days Held | The maximum number of days a security has been held using the indicated trading system/model throughout its history. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | positive integer representing calendar days |
Mean Days Date | The date when the current trade is likely to meet the Trade Profile Mean’s value. It is estimated using the average holding period for all trades in a security throughout its history. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | date input using YYYY-MM-DDDraw Down format |
Min Days Held | The minimum number of days a security has been held using the indicated trading system/model throughout its history. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | positive integer representing calendar days |
Net Profit % | The cumulative percentage gain for all trades in a security using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal percentage where 52.30745% is input as .5230745 |
Optimized Net Profit % | The cumulative percentage net gain for all trades in a security using the indicated trading system/model. It looks at the model with the largest Net Profit % over the last 6 month period (periods being Jan 1-Jun 30 and Jul 1-Dec 31). | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | decimal percentage where 52.30745% is input as .5230745 |
Projected Max Date | The date when the current trade is likely to meet the Projected Max Days value. It is estimated by adding the Current Duration value to the Trade Profile Std Dev value. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | date value input using YYYY-MM-DDDraw Down format |
Projected Max Days | Calculated by adding the Current Duration value to the Trade Profile Std Dev value. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | positive integer representing calendar days |
Stats Run Time | Date corresponding to the last time the statistics were updated for a security using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | date value input using YYYY-MM-DDDraw Down format |
Total Trades | The number of trades, as defined by a buy and subsequent sell, for a security using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | positive integer representing trades |
Trade Profile Mean | The average or expected number of days a security is expected to be held using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | positive integer representing calendar days |
Trade Profile Std Dev | The standard deviation of the number of days a security is held on average using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | positive integer representing calendar days |
Winning Trades | The number of trades, as defined by a buy and subsequent sell, that resulted in positive returns for a security using the indicated trading system/model. | Equal, Not Equal, Greater Than, Less Than, Greater or Equal, Less or Equal, Between | positive integer representing trades |