DAS Locate Scripting: Inquiry, Request and Results
Read InquiryShare, Inquire and LocateLowest as separate stages with distinct effects.
Separate an inquiry, a locate and an order
Locate belongs to the stock-borrow workflow. It is distinct from a market quote or a short-sale order. InquiryShare sets an inquiry quantity, Inquire requests a quote, and LocateLowest performs a locate action. A short command name does not make it read-only.
| Stage | Evidence obtained | What it does not establish |
|---|---|---|
| Populate symbol and quantity | Prepared request inputs | A provider has not yet replied |
| Inquiry response | Provider quantity, price and other response data | A successful locate |
| Locate result | Actual borrow-request outcome | Acceptance or execution of a later order |
| Order acknowledgement | That trading order's status | A substitute for locate records |
The following stages unpack the official Short Locate tutorial. Example quantities do not recommend how many shares to borrow. Fees, availability, permissions and result fields depend on the broker, provider and DAS build.
Configure the window first
Open Short Locate, right-click its title bar and name it feLocate. In the window, explicitly select the practice symbol, applicable account/provider and other required fields. Confirm a suitable practice Locate environment with the broker. A simulated trading account does not establish that Locate actions are simulated or free.
Use the ShortLocate category in Hotkey Script Builder to verify current-build commands. GetWindowObj takes your assigned window name, not a window-type identifier. These examples keep the symbol already selected in that window; they do not invent cross-broker symbol or routing configuration.
Step one: populate quantity only
Advanced Script · Changes Short Locate input; sends no inquiry. Requires the configured feLocate window. The quantity 110 is illustrative.
$feLocateWindow = GetWindowObj("feLocate");
$feLocateWindow.InquiryShare = 110;
Inspect the window: quantity should be 110 and symbol/provider should match the preparation record. InquiryShare belongs to the Locate window; it is neither Montage Share nor filled quantity.
Step two: request an inquiry separately
Advanced Script · Sends an inquiry to the configured provider. Verify the inputs and that your practice environment permits the query before running. This is not a purely local read.
$feLocateWindow = GetWindowObj("feLocate");
$feLocateWindow.Inquire;
.Inquire; is the command form in the official example. Do not silently rewrite it as .Inquire(). Wait for the window to show this request's response, then inspect symbol, requested and returned quantity, per-share price, total cost and terms. Old rows, blank responses, errors and timeouts are not successful responses.
Reaching the next script statement does not establish completion of an asynchronous inquiry. A fixed delay cannot prove provider-side state. Keep inquiry and locate commitment out of an unconditional combined hotkey.
Step three: understand the locate action
The official tutorial uses the command below to locate shares. Code reading · Requests a locate and may incur fees. It stays commented so learners can see the exact syntax without making it an execution exercise. Configure this stage separately only after reviewing the quote, quantity, fees, permissions and provider terms in an explicitly chosen environment.
// $feLocateWindow.LocateLowest;
Lowest does not guarantee the cheapest borrowing across all providers and times, or establish that the requested quantity was allocated. Check the broker's comparison scope and execution rules. Reconcile located quantity, remaining quantity, fees and failures against the actual result.
After an unknown outcome, inspect the original request before retrying to avoid duplicate locates or fees. Resetting a variable, closing a window or cancelling a trading order does not establish reversal of a locate charge.
Extend commands without mixing interfaces
Builds and brokers may expose InquireAll, automatic Locate, price limits or other commands. Find the exact current-build ShortLocate documentation, then record target window, arguments, units, submission effects and result evidence. Another broker's hotkey is not a universal template. CMD API protocol commands are not interchangeable with Hotkey Script syntax.
Expand every helper called through Exec or ExecHotkey: a caller that appears to populate fields may reach LocateLowest inside a helper. Include all reachable external actions in the review.
Lab: map states to evidence
Practice quantity entry first. If inquiries are supported in your practice environment, record transitions from not requested to waiting, then returned, failed or unknown. For insufficient quantity, blank response, timeout and repeated clicks, write the next reconciliation step. Inspect the original request when state is unknown. Locate submission remains a reading exercise, not a requirement for completing the lesson.
Inquiry, acceptance and usable quantity differ
An inquiry response does not automatically establish acceptance, payment or borrow available to that account. A locate request can result in partial quantity, rejection or unknown status. Record request, provider response, acceptance action, final quantity and fees separately rather than compressing them into one done flag.
A response belonging to the previous symbol cannot be reused merely because new InquiryShare was populated successfully. Symbol, account, provider, requested quantity and response time must correspond to the current operation.
Worked answer
After Inquire, establish only the inquiry entry and the response actually observed; do not record borrow obtained. LocateLowest can incur fees and should not be blindly retried after a timeout. Reconcile provider and account records when status is unknown.
Locate workflow adds a fictional-response cost calculator, partial-quantity handling and acceptance matrix without inventing universal quote-reading methods or broker routes.