DAS Advanced Script Language and API Reference
Signatures, context, side effects and evidence. A reference for the APIs used in this course.
How to use this reference
This reference explains the language and APIs used in the course. Use the topic links for complete exercises and worked answers; per-window and broker-specific contracts still require verification. Documented means an official source describes it. Not client-tested means FennEdge has not verified it on a specific DAS build. Unconfirmed means the exact contract is not established by these sources.
Baseline: Advanced Hotkey Guide and DAS Order Objects V2, 2025-06-27; official order/locate articles, 2026-08-03; Trigger Guide, 2026-07-06; OCO guide, 2026-06-30. Sources checked: 2026-09-11. A document date is not a minimum supported build. Verify behavior in your own build, window and account context.
Variable assignment
$name = expression;
Global variable assignment replaces the value. Names are case insensitive; do not infer account isolation or persistence across restart.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 4
Control flow
if (condition) { ... } else { ... }
Conditional branch; documented examples use == for comparison, return; ends execution, and while has a version-specific iteration limit. Error continuation still needs testing.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 5
MsgBox
MsgBox(value1, value2, ...)
Global function displaying values for user interaction. It is not an order acknowledgement; this guide does not specify a return value to depend on.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 7
GetWindowObj
GetWindowObj("windowName")
Takes a configured window name and returns a window object. Missing, closed and renamed target behavior needs client testing.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 11
ShowObject
$object.ShowObject()
Object inspection method showing exposed properties. Do not assign the inspection method result as if it were the original object.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 15
GetQuoteObj
GetQuoteObj("symbol")
Gets a quote object for a symbol; market properties are read-only, while the separate data slot is writable. Load the relevant quote first. Missing-data behavior and freshness need separate checks.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 17
GetAccountObj
GetAccountObj("account")
Gets an account object; the guide demonstrates BP, which is not a permitted risk amount. Use an explicitly verified simulator account.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 10
GetStudyVal
$chart.GetStudyVal("studyName")
Chart method reading the latest numeric value of a named study. Verify interval, session, multiple outputs and missing-study behavior separately.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 36
GetBar
$chart.GetBar(-5)
The documented example reads the fifth-last displayed bar and returns an inspectable bar object. Do not extrapolate undocumented indices or missing-value conventions.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 36
Round
Round(value, precision)
Precision has special meanings: the guide lists decimal precisions 1–6 and even-lot behaviors for 100 and 101. It is not a generic floor alias; test the intended quantity/price rule.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 7
ExecHotkey
ExecHotkey("hotkeyName")
Executes a named script in the hotkey file. Effects depend on its body; review its code, variables and target context.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 38
GetSecond
GetSecond()
Returns seconds since midnight. It is not a Unix timestamp; confirm timezone, day rollover and precision in the target environment.
Status: documented · not client-tested. Advanced Hotkey Guide · p. 7
Exec
Exec(script1, script2, ...)
Executes script strings or variables holding them. Escape inner double quotes. No transaction or local-variable isolation is established; effects depend on the body.
Status: officially documented · not client-tested. Advanced Hotkey Guide · pp. 37-40
GetHotkeyScript
GetHotkeyScript("hotkeyName")
Retrieves named-hotkey source without executing it. GetHokeyScript is a misspelling; missing-name return behavior needs client testing.
Status: officially documented · not client-tested. Advanced Hotkey Guide · pp. 37-38
DrawHorzLineWithPrice / Color
DrawHorzLineWithPrice(price, Color(100, 100, 100))
Draws a horizontal reference on a Chart in the correct execution context. Color("RED") is also documented. Drawing once neither establishes live study updates nor creates an order.
Status: officially documented · not client-tested. Advanced Hotkey Guide · pp. 36-37
GetMousePtPrice
GetMousePtPrice()
Reads the chart price under the pointer. Bind a hotkey and trigger over the Chart; behavior outside the plot needs client testing.
Status: officially documented · not client-tested. Advanced Hotkey Guide · pp. 36-37
RemoveAllTrendLines
RemoveAllTrendLines;
Clears trend lines; this removes drawings rather than undoing only the last line. Save the layout and verify linked/global-line scope on a dedicated practice chart.
Status: officially documented · not client-tested. Advanced Hotkey Guide · pp. 37
NewAlertObj / AddItem / Save
NewAlertObj() · $alert.AddItem("L1 BID", ">", threshold) · $alert.Save()
Creates an Alert object; set name and Symb, add a condition and save. The guide demonstrates Reset() then Save() for removal. Inspect duplicate names, repeat behavior and defaults; configure the Script field separately in Alert settings.
Status: officially documented · not client-tested. Advanced Hotkey Guide · pp. 33-34
GetAlertObj: contract unconfirmed
The heading on pp. 33–34 mentions this function, but the body does not establish lookup arguments or missing-result behavior. No speculative signature is supplied. Creation and cleanup examples are in Alerts and trigger scripts.
Status: heading mention · detailed contract unconfirmed · not client-tested. Advanced Hotkey Guide · p. 33
Locate window commands
| Form | Effect |
|---|---|
$window.InquiryShare = 110; |
Populates inquiry quantity |
$window.Inquire; |
Requests an inquiry from the configured provider |
$window.LocateLowest; |
Performs a locate action and may incur fees |
$window must refer to the configured, named Short Locate window. Verify symbol and account/provider. These command forms have no function parentheses. Reconcile the current response; reaching the next statement does not prove completion. See the staged examples in the Locate lesson.
Status: officially documented · not client-tested or broker-tested. DAS · Short Locate
Input
Input(title, message) · Input()
A global interactive input function. Page 7 shows title/message arguments; page 40 shows the zero-argument form. Treat the result as user input rather than relying on implicit numeric conversion. Cancellation, empty text and whitespace are not fully specified; absence is not a valid zero. Reset readiness before requesting input and publish only after validation. Never pass the input directly to Exec.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 7,40 · Lesson and exercises
GetVar / SetVar / DelVar
GetVar(name) · SetVar(name, value) · DelVar(name1, name2, ...)
Read, write or delete globals by string name. GetVar returns the corresponding value; SetVar and DelVar mutate shared state rather than a private dictionary. The reviewed description does not settle a $ prefix in the string, missing-variable results or post-deletion access. Start with a same-string Set/Get/Del naming probe without claiming equivalence to a $ identifier. Stop callbacks before deleting their dependencies.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 7 · Lesson and exercises
NewUserObj
NewUserObj()
Create a custom object to hold a defined configuration, state or result structure. Names such as version, valid and count are course conventions, not reserved platform protocols. Initialize consumer-visible fields before publishing the record. Assignment does not establish a documented deep copy; create independent objects explicitly. Neither objects nor globals imply persistence or account isolation.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 29-32 · Lesson and exercises
Set / Get / Del
object.Set(key, value) · object.Get(key) · object.Del(key)
Keyed object access, with numeric keys and Del("") shown in the guide. Numeric keys plus a count you maintain can represent a collection; this is not a JavaScript Array. Do not invent Length, push, map, iterators or automatic index shifting. Deleting a middle item does not establish compaction: define holes or rebuild explicitly. Del("") clears contents rather than one selected record.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 29-32 · Lesson and exercises
Quote fields / data
quote.BID · ASK · LAST · HI · LO · VOLUME · SYMBOL · data
Market fields read quote data; data is writable attached state. Keep the two categories separate. Establish ownership before assigning a custom object to data, or another script may lose its state. Sequential reads are not atomic; attaching a read time does not prove feed freshness. Represent account context explicitly in your own record keys.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 10,29-32 · Lesson and exercises
Window title, ticker and focus
$window.GetWindowTitle() · $window.GetTicker() · FocusWindow name;
GetWindowTitle and GetTicker read current context; FocusWindow changes focus by configured name and is a command without parentheses. Reading context does not lock the target of later bare commands. Named GetWindowObj lookup and foreground focus are separate mechanisms. Verify duplicate names, closed windows and type mismatches without guessing missing results.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 11,21 · Lesson and exercises
NewOrderObj / fields
NewOrderObj() · NewOrderObj(shortForm)
Create an order-object draft. Listed fields include Account, Symbol, Price, Share, Open, Side, Tif, Route, RefNum, Status and Type; their names do not supply a complete Open/Status state contract. V2 covers short-form construction. Set identity and fields explicitly and inspect with ShowObject. Creation or assignment is not submission; Send stays commented in the examples.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 22-28 · Lesson and exercises
Clear / Send / Cancel
order.Clear() · order.Send() · order.Cancel()
Clear clears object contents rather than canceling a submitted order. Send requests submission and Cancel requests cancellation; call completion differs from external acceptance, fills or cancellation. Establish whether the object is an intended draft or an existing record. A documented sending-rate note needs current build/broker verification; loops or Wait cannot establish throughput. Reconcile existing requests before retrying.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 22-23 · Lesson and exercises
Order Objects V2 grammar
Side Share Symbol Route OrderType OtherPrice Price TIF
This is short-form parsing by NewOrderObj, not a NewOrderObjV2 function. Missing fields can inherit Default Order Templates; the documented default side is Sell. Side aliases include B/BUY, S/SELL and SS/SHRT/SHORT. Parser aliases D and D+ do not establish interchangeable property assignments with DAY and DAY+. Changing Route does not automatically correct Type. Set account before any Send and consult the errata for Sell examples and Range ordering.
Status: documentation reviewed; uncertainties above remain open; not client-tested. DAS Order Objects V2 · pp. 1-5 · Lesson and exercises
Order types / Peg / TIF
M · L · P · SM · SL · SLP · TL · RG · RGM
Types cover Market, Limit, Peg, Stop Market, Stop Limit, pre/post-market Stop Limit, Trailing, Range and Range Market. SL places trigger before limit. Numeric trailing distance and a % distance have different units. Peg strategies include AGG/MID/PRIM/LAST and require route support. SLP requires broker enablement. Listed TIFs include DAY, DAY+, AtOpen, AtClose, FOC, IOC, GTC and GTC+. Preserve the source spelling FOC rather than silently changing it to FOK. These are documented terms, not universal account/route support.
Status: documentation reviewed; uncertainties above remain open; not client-tested. DAS Order Objects V2 · pp. 3-5 · Lesson and exercises
GetOrderObj
GetOrderObj(filter)
Read an order object by filter. The compound-filter section specifies 5.7.9.9+ and lists Acc, Symb, Oid, RefNum, Price, Share, First and Last with comma-separated combinations; the lesson supplies examples. The result is the first matching record, not an order array. Start with a known RefNum and compare with Orders. Symbol alone can select the wrong account. Missing-result behavior requires testing rather than an invented safe empty object.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 23,29 · Lesson and exercises
Account CancelOrder
account.CancelOrder(flag, symbol, price)
Account-scoped cancellation with the receiver and arguments defining scope. The guide lists BUY, SELL, FIST, LAST, P>, P<, P=, P>= and P<=, combining flags with |, such as BUY|P<. FIST remains a source-spelling question, not silently corrected to FIRST in an executable example. Understand the potentially multiple-order effect and reconcile every final state afterward.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 10 · Lesson and exercises
WithTrigger / OCO
WithTrigger=RT:... PX:... ACT:... QTY:... TIF:...;
A legacy structure attaching secondary instructions to a primary; the Trigger Guide describes triggering after full primary execution. QTY:POS is not fixed primary Share. OCO establishes cancellation linkage, not merely two independent orders. The lesson provides fully commented WithTrigger reading and official UI/Wizard steps without inventing unchecked OCO hotkey syntax.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Trigger Order Guide · 2026-07-06 · Lesson and exercises
Timer Event / Chart Update Script / DesktopLoadScript
Event callback bodies configured in DAS
The Timer is documented as once per second, Chart Update follows chart updates, and DesktopLoadScript is a desktop-load entry point. These are not interchangeable clocks. Bound callback work and avoid blocking dialogs, infinite waiting and implicit repeated actions. Define initialization, enabling, observation, disabling and cleanup. Stop entry points before deleting data; a course-defined enabled field does not remove platform event configuration.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 6,18-19,35 · Lesson and exercises
Wait
Wait(milliseconds)
Pause the current script for a duration in milliseconds. Keep this unit distinct from GetSecond seconds. A delay is not broker acknowledgement, a feed-freshness guarantee or a background scheduler. Long waits in events affect interaction and cadence. Prefer bounded callbacks and explicit skipped-interval, catch-up and clock-rollback policies; the course skips backlog rather than replaying a burst.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 8,18-19 · Lesson and exercises
Speak / PlaySound
Speak(text, device, flag) · PlaySound(file, device, flag)
Generate speech or play local WAV/MP3 audio. Devices are local names; flags include INTRPT, SHARE, STOP and LOOP. Repeated events can overlap or loop audible effects. Verify a single playback and stop path before event integration. Playing a file does not establish arbitrary file I/O, JSON, CSV or network download APIs.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 7-8 · Lesson and exercises
Application and desktop commands
NewWindow · SaveDesktop · SaveLayout · SwitchDesktop · Shell
The Global App table lists window/layout/theme actions, speech, quote pause/resume, recording and external opening. Commands without parentheses have no function return value. SaveLayout overwrites the current layout and ClearDesktop clears windows. Shell and HTTP/HTTPS are external actions, not a JSON-returning fetch. Panic concerns account liquidation, not ordinary error recovery. The course reviews these effects without exposing automatic liquidation or arbitrary external execution.
Status: documentation reviewed; uncertainties above remain open; not client-tested. Advanced Hotkey Guide · pp. 8-9 · Lesson and exercises
Legacy commands and actions with side effects
| Token / category | Effect | Review |
|---|---|---|
Price / Share |
Change Montage inputs | Focus, inherited fields and units |
BUY=Load |
Load buy-order information | Do not press Enter; ticket state still changes |
BUY=Send / SELL=Send |
Submit an order | Account, route, TIF, quantity and acknowledgement |
TriggerOrder |
Attach a secondary order | Primary conditions, partial fills and child confirmation |
| Cancel commands | Request cancellation | Exact build syntax and account/symbol scope |
InquiryShare / Inquire |
Configure quantity / request inquiry | Window, provider and response |
LocateLowest |
Perform a locate action | Quantity, fees, validity and result |
These entries identify effects; they are not a complete executable recipe. Sources: Order fields and Load/Send, Linked orders, Locate.
Reference coverage
| Reference category | Included here | Still unconfirmed |
|---|---|---|
| Syntax, operators, variables, control flow | Constructs used in the course | Complete operators, conversions and error continuation |
| Global functions and windows | Minimum contracts above and inspection | Undocumented per-window properties and missing-result behavior |
| Order objects | Construction, V2 grammar, types, lookup, cancellation and lifecycle | Missing-result contracts, contradictory examples and build tests |
| Charts, quotes and accounts | Read APIs and data semantics | Multiple outputs, missing values and cross-window consistency |
| UI, time and events | Input, audio, Timer, Chart Update and DesktopLoadScript | Callback, reentry and disconnect behavior |
| Files and external interaction | Effect review method | Per-API permissions and contracts |
| Constants, errors and compatibility | Recording method and unknown markers | Broker route inventory, error codes and minimum builds |
An unverified capability is not necessarily unsupported. Record the signature, arguments, result, effects, source page, build and test evidence for every addition. Preserve conflicting documentation instead of guessing from a similar language.