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
30
Lesson 30 of 36 · About 26 min

DAS Script Audio, External Actions and Diagnostics

Use Speak and PlaySound deliberately, and separate shell actions from script logic.

Choose the output channel

Prerequisite: callbacks and effect classification. MsgBox blocks for user interaction; Speak uses speech output; PlaySound plays an audio asset. A popup in a frequent callback can stop normal interaction, and a sound loop needs an explicit stop path. Choose the channel by purpose: interactive inspection, brief event notification or persistent visual status.

Documented audio arguments

The guide gives Speak(text,device,flag) and PlaySound(file,device,flag), WAV/MP3 files, device names and INTRPT, SHARE, STOP, LOOP flags. Optional-argument behavior is illustrated for PlaySound(file); do not assume every function has identical defaults. Device names belong to the local computer, not a portable account configuration.

One manual audio check

Advanced Script · local audio. Create or select a short file named fe-notice.wav in a location supported by your DAS setup before running the first line. The device-specific fragments remain code-reading examples until that device and flag behavior are confirmed.

Audio example

PlaySound("fe-notice.wav");
// Device-specific examples after verifying the actual device name:
// Speak("Observation updated", "Speakers", "SHARE");
// PlaySound("fe-notice.wav", "Speakers", "LOOP");
// PlaySound("fe-notice.wav", "Speakers", "STOP");

External links and Shell are a separate boundary

The global command list mentions HTTP/HTTPS links and Shell. That establishes the existence of external actions, not a general HTTP client, JSON parser, file API or secure secret store in Hotkey Script. Do not put credentials into shared hotkeys or pass arbitrary Input text to a shell. CMD, .NET and FIX are separate DAS APIs with separate protocols; code from those interfaces is not automatically valid inside this language.

Diagnostics without an invented logger

Use a structured NewUserObj record with phase, input identity, observation time and error text, inspect it with ShowObject and capture the relevant platform logs/screenshots. The reviewed guide does not establish Print(), console.log(), WriteFile() or try/catch for this course. For external automation, design a separate adapter and document its authentication, data scope and failure modes. Keep that material outside the executable Hotkey examples until its own interface is sourced.

Exercise and worked answer

An observer plays a sound on every sample above threshold. Repair it. Answer: reuse the edge detector, issue audio only on the 0→1 transition and provide a stop/uninstall procedure. Test muted devices, missing files and repeated conditions. Audio failure must not be interpreted as a failed or successful broker action; it is an output-channel failure.