ποΈ Getting Started
Welcome to the NightShark knowledge base. This tutorial track focuses on the scripting fundamentals you need to automate trades quickly and safely.
ποΈ Pre-Built Functions
NightShark ships with a handful of helpers that remove tedious boilerplate from your automation scripts. Mastering these functions lets you focus on strategy logic instead of UI handling.
ποΈ Logging with Log()
NightShark includes a built-in Log() helper so you can record what your script is doing without breaking execution. Logs appear immediately in the NightShark console and inside the application log window.
ποΈ Defining Functions
Functions let you package trading logic once and reuse it everywhere. They reduce duplication, clarify intent, and make it easier to test new ideas.
ποΈ Introducing Variables
Variables are the building blocks of every NightShark strategy. They capture market state, track progress, and feed decision logic throughout your script.
ποΈ Reading Areas
read_areas() is the heartbeat of every NightShark script. It refreshes the values from each region you mapped in the desktop recorder so your automation always works with live data.
ποΈ Clicking Buttons
Click() is how NightShark presses on-screen controls for you. Use it to execute entries, exits, modal confirmations, or any other GUI interaction required by your trading platform.
ποΈ Converting to Numbers
On-screen values arrive as textβ$143.25, -12.5, 1.25%. Use toNumber() to turn them into numeric data NightShark can compare, add, and subtract.
ποΈ If-Else Statements
Conditional statements let NightShark scripts respond intelligently to market data. Use if, else if, and else blocks to define exact rules for when your automation should act.
ποΈ Using Loop Constructs
Loops keep your NightShark script running, checking, and reacting without human input. They repeat a code block until a condition tells them to stop.