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
33
Lesson 33 of 36 · About 25 min

Capstone: A Read-Only DAS Inspection Tool

Combine explicit dependencies, a guard and an observable result.

The contract

Build a one-shot spread inspector for a named Montage. It reads two prices, rejects non-positive or inverted inputs, and displays their difference. It never selects a trade, changes an order ticket, or requests a locate.

Advanced Script · read and display · not client-tested by FennEdge. Requires Advanced Script, a named feMontage, and working quote data. Check the object using lesson 1 first; missing-object behavior is outside this sample's guards.

$feWindow = GetWindowObj("feMontage");
$feBid = $feWindow.BID;
$feAsk = $feWindow.ASK;
$feSpread = 0;
if ($feBid > 0) {
    if ($feAsk > 0) {
        if ($feAsk < $feBid) {
            MsgBox("Inverted quote: inspect feed");
            return;
        }
        $feSpread = $feAsk - $feBid;
        MsgBox($feSpread);
    } else {
        MsgBox("Ask unavailable");
        return;
    }
} else {
    MsgBox("Bid unavailable");
    return;
}

Trace it before you run it

With fictional Bid 12.40 and Ask 12.43, the mathematical result is 0.03. Equal positive prices produce zero. A zero Bid or Ask stops with a message. An Ask below Bid stops with an inverted-quote message. These are input validation rules for this exercise, not a universal classification of all market conditions.

Two property reads are not an atomic market snapshot. The quote can change between reads; the script also does not prove freshness, subscription quality or execution price. Write those limitations beside the result in your lab notes.

Acceptance checklist

  1. Confirm exact build, simulator environment, window and symbol.
  2. Trace each branch with fictional numbers before reading live data.
  3. Verify that the script contains no ticket write, submission, cancellation, locate or helper call.
  4. Run once, record observation time and compare with the visible quote.
  5. Repeat after changing focus and then symbol; explain every result.

Connect the learning to your workspace

Use Research to examine source-linked ticker evidence and Trade Log for your own review. A script observation belongs beside its timestamp and configuration; it does not become a FennEdge market verdict. Keep private account identifiers out of shared notes.

Deliver a reproducible tool

Deliver naming instructions, dependencies, input/output fields, expected examples, failure branches and a stop procedure alongside source. Another reader should be able to prepare the same objects in their own simulator from these instructions.

Report current validity and never leave last run's spread exposed as a current result after failure. Preserve history in separate explicitly historical fields when needed. Sequential Bid/Ask reads do not establish an atomic snapshot.

Project path

Project Programming capability Acceptance focus
Multi-symbol notebook Collections, record structure and per-row validation Independent rows; no stale fallback
Event observer Timer, state machine, hysteresis and lifecycle No repeated event inside one region; clock rollback handled
Order audit desk Precise lookup, quantity reconciliation and evidence classification Identified records; requests separate from terminal results

Worked answer

When Ask is below Bid, do not present an effective negative spread. Mark this observation invalid and retain inputs for investigation. A missing name requires dependency repair; it is not normal market data that can be replaced by zero. Establish these boundaries before moving reads into more frequent event entry points.