FennEdge Learn · Programming

DAS Trader Advanced Hotkey Script Course

Understand the code. Inspect the state. Verify the outcome. A detailed path through Advanced Script: language, data structures, order objects, event workflows and complete practice projects.

Plan about 1046 minutes including reading, worked examples, and each lesson exercise; actual time varies.

36Lessons≈1046Est. minutes—Sign in to save progress
18
Lesson 18 of 36 · About 32 min

DAS Order Filters, Order Identity and Cancellation Scope

Build GetOrderObj filters and distinguish one result from an order set.

A symbol is not an order identity

Prerequisite: order objects and lifecycle. GetOrderObj("Symb=MSFT") searches for a first matching order; it does not return every MSFT order. Multiple accounts, multiple directions and multiple submissions make a symbol-only lookup ambiguous. Prefer the specific order reference obtained from observed platform records and include account and symbol when supported.

The documented filter surface

The guide lists Acc, Symb, Oid, RefNum, Price, Share, First and Last, with numerical comparisons >,<,<=,>=. It documents comma-separated multiple filters for build 5.7.9.9+. That version statement applies to this feature, not every function in the course. It does not provide a complete escaping grammar, wildcard contract or SQL syntax. Do not interpolate arbitrary user input into a filter.

Read a known simulated record

Advanced Script · query and inspect. Replace the placeholder account and RefNum with a known existing simulator order. A failed lookup followed by ShowObject can produce an error; the source does not establish a portable null-check idiom. Start with a record you have already verified in Orders.

Lookup example

$feOrderFilter = "Acc=TR_PRACTICE,Symb=MSFT,RefNum=17";
$feMatchedOrder = GetOrderObj($feOrderFilter);
$feMatchedOrder.ShowObject();

Cancellation has two different scopes

The order-object inspector lists Cancel on one object. The account method CancelOrder(flag,symbol,price) selects a scope. The documented BUY|P< example means matching buy-side orders below a price for that account and symbol; it is not equivalent to cancelling the first search result. The flag string contains | as data, not the language’s boolean operator. The guide prints FIST in its flag list: do not silently correct it to FIRST without build-specific confirmation.

Read the destructive operation separately

// Code-reading examples; do not join them to the query hotkey.
// $feMatchedOrder.Cancel();
// $feAccount = GetAccountObj("TR_PRACTICE");
// $feAccount.CancelOrder("BUY|P<", "MSFT", 25.00);

Exercise and worked answer

A simulator account has two MSFT orders at 24 and 26, and another account has an MSFT order at 23. What is the documented scope of BUY|P< with threshold 25 on the first account, assuming all three are buy-side orders? Answer: the first account’s 24 order; not its 26 order and not the other account’s 23 order. A cancel request is not confirmation; reconcile remaining orders and fills before retrying.