| Documentation

DipScript Language Reference

DipScript is a Domain-Specific Language for creating automated stock trading strategies. Write trading rules in readable syntax that executes line by line as market conditions change.

No results found

Try adjusting your search terms or browse the navigation menu.

Introduction

DipScript bridges the gap between complex algorithmic trading and accessible strategy creation. Whether you're a seasoned trader or just starting out, DipScript allows you to translate trading concepts directly into executable code without requiring extensive programming knowledge.

What Makes DipScript Different?

Traditional trading platforms require you to manually watch the market and execute trades. Programming-based solutions require advanced coding skills. DipScript gives you the best of both worlds: automation with simplicity.

  • Human-Readable Syntax: Write "IF $PROFIT > 1000 THEN SELL $ALL" instead of complex code
  • Real-Time Execution: Your strategy runs continuously, checking conditions as the market moves
  • Built-In Variables: Automatic tracking of profits, positions, and market data
  • Smart Percentages: Natural percentage calculations that work the way you think
  • No Manual Monitoring: Set it and let it run—perfect for day trading when speed matters
Simple Example
Here's a basic momentum strategy that demonstrates core DipScript concepts:
TICKER NVDA

// Buy if we haven't bought before
IF $LAST_BUY_PRICE = NULL THEN OBTAIN 400 @ $MARKET_PRICE

// Take profit when up $1000
IF $PROFIT > 1000 THEN SELL $ALL @ $MARKET_PRICE

This script buys 400 shares of NVIDIA at the current market price (if you haven't bought yet), then automatically sells everything when your profit reaches $1,000. No watching required.

How It Works — DipSkip, You & Tradier

DipSkip is not a broker. It is an automation layer that sits between you and your Tradier account. Tradier is a regulated, API-first broker. Your money, positions, and orders all live at Tradier — a regulated, API-first brokerage. DipSkip connects to Tradier's platform via their official API to execute your trading strategies on your behalf.

To use DipSkip, you need a Tradier account. Sign up at tradier.com to get started, then connect your account to DipSkip via OAuth in the Tradier Connection settings.

The Three Layers

Layer Role What It Does
You Strategy Author Write DipScript strategies, define trading rules, set risk parameters, and monitor performance.
DipSkip Automation Layer Continuously evaluates your scripts against live market data, and sends trade instructions (buy/sell orders) to your broker via their API.
Tradier Broker Holds your funds, executes orders on the stock market, provides real-time market data, and handles regulatory compliance.

What DipSkip Does

  • Runs your DipScript strategies continuously during market hours
  • Monitors live market data (prices, positions, account balances) via Tradier's API
  • Evaluates your trading conditions line by line
  • Sends order instructions (OBTAIN/SELL) to Tradier when conditions are met
  • Tracks performance, logs trades, and sends you alerts

What Tradier Does

  • Holds your account and funds
  • Receives order instructions from DipSkip through their API
  • Executes the actual buy and sell orders on the stock market
  • Provides real-time and historical market data
  • Handles all regulatory and compliance requirements

Your Credentials Stay with Tradier

DipSkip connects to your Tradier account using OAuth — the same secure authorization method used by major platforms. You log in directly on Tradier's website and grant DipSkip permission to place trades. Your Tradier username and password are never shared with DipSkip.

DipSkip Never Holds Your Money

All funds remain in your Tradier account at all times. DipSkip only sends trade instructions — it cannot withdraw, transfer, or move your money. You can revoke DipSkip's access from your Tradier account at any time.

Why DipScript for Day Trading?

Day trading requires split-second decisions and constant market monitoring. Missing a price movement by seconds can mean the difference between profit and loss. DipScript solves this by executing your trading rules automatically, faster than any human can.

The Day Trading Challenge

Imagine you're day trading Tesla. You want to buy when the price dips 2% below your last sell, and sell when you're up $500. Doing this manually means:

  • Constantly watching the price ticker
  • Calculating percentages in your head
  • Remembering your last sell price
  • Placing orders manually (and hoping you're fast enough)
  • Tracking your profit across multiple trades

With DipScript, this becomes two simple lines:

IF $MARKET_PRICE <= $LAST_SELL_PRICE - 2% THEN OBTAIN 100 @ $MARKET_PRICE
IF $PROFIT > 500 THEN SELL $ALL @ $MARKET_PRICE

Perfect for Multiple Trading Styles

  • Scalping: Quick in-and-out trades capturing small price movements
  • Momentum Trading: Riding price trends with trailing stops
  • Breakout Trading: Automatic entry when price breaks resistance levels
  • Mean Reversion: Buying dips and selling rallies systematically

For Non-Programmers

You don't need to be a programmer to use DipScript. If you understand trading concepts like "buy low, sell high" and "stop loss," you can learn DipScript. The syntax is simple and readable: "IF $PROFIT > 500 THEN SELL $ALL @ $MARKET_PRICE."

Quick Start

Every DipScript follows the same basic structure:

  1. Ticker Declaration: TICKER [SYMBOL] (required first line)
  2. Trading Rules: IF statements and commands that define your strategy
  3. Execution: Scripts run continuously, checking conditions as market data updates

Syntax Rules

  • All syntax keywords are UPPERCASE (IF, THEN, OBTAIN, SELL, etc.)
  • Variables start with $ and contain no spaces
  • Each IF statement performs only one action
  • Comments start with //
  • Commands follow: <ACTION> <AMOUNT> @ <PRICE>

Your First Strategy in 5 Minutes

Let's build a simple profit-taking strategy step by step:

// Step 1: Declare what stock you're trading
TICKER AAPL

// Step 2: Buy 100 shares if you don't have any yet
IF $ALL = 0 THEN OBTAIN 100 @ $MARKET_PRICE

// Step 3: Sell when profit hits $200
IF $PROFIT > 200 THEN SELL $ALL @ $MARKET_PRICE

// Step 4: Cut losses if down $100
IF $PROFIT < -100 THEN SELL $ALL @ $MARKET_PRICE

That's it! This strategy automatically buys 100 shares of Apple, takes profit at $200 gain, and cuts losses at $100 down. The script runs continuously and executes these rules for you.

Language Structure

DipScript uses a simple, readable syntax where each line represents a complete instruction. Here's a visual guide to how the language and engine work together.

How the Engine Works

Your script runs in a continuous loop. The engine reads your strategy top-to-bottom, evaluates conditions against live market data, and executes actions when conditions are met.

STEP 1 Write Script STEP 2 Read Top to Bottom STEP 3 Evaluate Conditions STEP 4 Execute Actions repeats on every market data update CONTINUOUS EXECUTION LOOP

Script Anatomy

Every strategy is a sequence of lines. Each token is color-coded by its role:

1 TICKER NVDA Declare the stock to trade
2 SET $LIMIT = 500 Define a reusable variable
3 IF $PROFIT > $LIMIT THEN SELL $ALL @ $MARKET_PRICE Conditional logic + action
4 IF $ALL = 0 THEN OBTAIN USD 10000 Re-entry when position is empty
Keywords Variables Operators Values Symbols

Line Types

Every line in a DipScript strategy is one of these six types:

TICKER

TICKER SYMBOL

Declare which stock to trade. Must be the first line of your script.

SET

SET $VAR = value

Define custom variables and reusable macro conditions for your strategy.

IF / THEN

IF condition THEN action

Conditional logic. When the condition is true, the action executes.

OBTAIN

OBTAIN 100 @ $MARKET_PRICE

Buy shares (or USD amount with USD keyword). Only buys what's needed to reach the target.

SELL

SELL $ALL @ $MARKET_PRICE

Sell a specific quantity or $ALL shares at market price or a limit price.

STOP

STOP

Immediately halt script execution. Use for emergency exits or end conditions.

Building Conditions

Conditions compare a variable to a value using an operator. Chain multiple conditions with AND / OR.

$PROFIT Variable > Operator 500 Value AND Connector next condition...

Available Operators

= Equal to
!= Not equal to
> Greater than
< Less than
>= Greater or equal
<= Less or equal
AND Both must be true
OR Either can be true

How Scripts Execute

DipScript processes your strategy line by line from top to bottom. When the market price updates, the engine checks each IF condition. When a condition becomes true, the associated command executes immediately. This happens continuously in real-time as market data streams in.

Important: Only one action can execute per line. If multiple conditions are true at the same time, they'll all execute (in order from top to bottom).

Variables

DipScript automatically tracks everything you need to know about your trades. You never have to manually calculate profits, remember prices, or track positions. Just reference the built-in variables.

All Available Variables

Variable Type Description
$PROFIT number Current profit/loss for active position
$TOTAL_PROFIT number Total profit/loss since script started
$PEAK_PROFIT number Highest profit reached since last sell
$PEAK_TOTAL_PROFIT number Highest total profit ever achieved
$ALL number Current quantity of shares owned
$HALF number Half of shares owned (half of $ALL)
$AMOUNT_OWNED number Same as $ALL
$MAX number Maximum shares affordable (for SELL commands, automatically becomes $ALL)
$MARKET_PRICE number Current real-time market price
$TICKER string Current stock symbol
$PEAK_PRICE number Highest market price since last trade
$LOWEST_PRICE number Lowest market price since last sell
$LAST_BUY_PRICE number Price per share of most recent purchase
$LAST_SELL_PRICE number Price per share of most recent sale
$LAST_BUY_AMOUNT number Quantity of shares in most recent purchase
$LAST_SELL_AMOUNT number Quantity of shares in most recent sale
$AMOUNT_INVESTED_SINCE_LAST_TRADE number Total dollars invested in current position
$TOTAL_AMOUNT_INVESTED number Total dollars invested across all trades
$BUY_TRADE_COUNT number Total number of buy transactions executed
$SELL_TRADE_COUNT number Total number of sell transactions executed
$ACCOUNT_EQUITY number Account equity (cash + stock value)
$BUYING_POWER number Available buying power in the account
$DAY_TRADES number Day trade count in rolling 5-business-day window
$REMAINING_DAY_TRADES number Remaining day trades before PDT flag (-1 if unlimited)

Profit & Performance Variables

These variables track your money—how much you're making or losing:

$PROFIT

Current profit/loss in dollars for your active position. Positive = making money, negative = losing money.

$TOTAL_PROFIT

Total profit/loss in dollars since your script started. Includes all closed trades.

$PEAK_PROFIT

Highest profit in dollars you've reached since your last sell. Useful for trailing stops.

$PEAK_TOTAL_PROFIT

Highest total profit ever achieved across all trades. Your all-time high.

Understanding Profit Variables
Here's how profit variables work in practice:
  • You buy 100 shares of NVDA at $100 each ($10,000 invested)
  • Price rises to $105: $PROFIT = $500, $PEAK_PROFIT = $500
  • Price rises to $110: $PROFIT = $1000, $PEAK_PROFIT = $1000
  • Price drops to $108: $PROFIT = $800, $PEAK_PROFIT = $1000 (unchanged)
  • You sell at $108: $TOTAL_PROFIT = $800, position closes
  • You buy again and make $300: $TOTAL_PROFIT = $1100

Calculating Profit Percentages

DipScript focuses on dollar values to avoid mathematical ambiguity. If you need percentage-based logic, calculate it using dollar variables:

// To check if profit is greater than 20%:
IF $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE * 20% THEN SELL $ALL @ $MARKET_PRICE

// To check if total profit is greater than 15% of total invested:
IF $TOTAL_PROFIT > $TOTAL_AMOUNT_INVESTED * 15% THEN SELL $ALL @ $MARKET_PRICE

Position & Trading Variables

These variables tell you what you own and your trading history:

$ALL / $AMOUNT_OWNED

How many shares you currently own. $AMOUNT_OWNED is an alias for $ALL. Use this to sell everything: SELL $ALL @ $MARKET_PRICE

$HALF

Half of the shares you currently own (half of $ALL). Useful for partial position exits: SELL $HALF @ $MARKET_PRICE

$MAX

Maximum shares you can afford at current price with available cash. Includes a 1% buffer for market order slippage to ensure your order doesn't fail due to price movement. Perfect for buying with all available funds: OBTAIN $MAX @ $MARKET_PRICE. Note: When used with SELL commands, $MAX is automatically converted to $ALL (your current position size), since "maximum affordable" doesn't apply to selling.

$LAST_BUY_PRICE

Price per share of your most recent purchase. Useful for calculating breakeven points.

$LAST_SELL_PRICE

Price per share of your most recent sale.

$LAST_BUY_AMOUNT

Number of shares in your most recent purchase.

$LAST_SELL_AMOUNT

Number of shares in your most recent sale.

Market & Investment Variables

Live market data and investment tracking:

$MARKET_PRICE

Current real-time market price of the stock. This is constantly updated and reflects live market data.

$TICKER

Current stock symbol (e.g., "AAPL", "TSLA"). Useful when running the same script on multiple stocks.

$PEAK_PRICE

Highest market price reached since your last trade. Great for trailing stops: IF $MARKET_PRICE < $PEAK_PRICE - 5 THEN SELL $ALL

$LOWEST_PRICE

Lowest market price since your last sell. Useful for dip buying strategies.

$AMOUNT_INVESTED_SINCE_LAST_TRADE

Total dollars you've invested in your current position. Resets when you fully exit a position.

$TOTAL_AMOUNT_INVESTED

Total dollars invested across all trades since script started. Cumulative value that never resets.

Trade Counting Variables

Track how many trades you've made:

$BUY_TRADE_COUNT

Total number of buy transactions executed. Useful for limiting entries: IF $BUY_TRADE_COUNT < 3 THEN OBTAIN 100

$SELL_TRADE_COUNT

Total number of sell transactions executed. Track your trading frequency and execution count.

Account & PDT Variables

These variables help you navigate Pattern Day Trader (PDT) rules and manage your account. PDT rules restrict accounts under $25,000 to 3 day trades per rolling 5-business-day period.

$ACCOUNT_EQUITY

Your total account equity (cash + stock value). Use this to check if you're above the $25,000 PDT threshold: IF $ACCOUNT_EQUITY >= 25000 THEN OBTAIN 100 @ $MARKET_PRICE

$BUYING_POWER

Your available buying power in the account. This is the amount you can use to purchase securities. For margin accounts, this may be higher than your cash balance. Use this to ensure you have sufficient funds before placing orders: IF $BUYING_POWER > 1000 THEN OBTAIN 10 @ $MARKET_PRICE

$DAY_TRADES

Number of day trades executed in the rolling 5-business-day window. A day trade is a buy and sell of the same security on the same day. Use this to track how close you are to PDT limits.

$REMAINING_DAY_TRADES

Number of day trades remaining before hitting the PDT limit. Returns -1 if your account has unlimited day trades (equity >= $25,000 or already flagged as PDT). For accounts under $25k, this shows how many of the 3 allowed day trades you have left.

PDT-Aware Trading Strategy
// Create a macro to check if day trading is allowed
SET $CAN_DAY_TRADE = $REMAINING_DAY_TRADES > 0 OR $ACCOUNT_EQUITY >= 25000

// Only enter trades if PDT rules allow
IF $LAST_BUY_PRICE = NULL AND $CAN_DAY_TRADE THEN OBTAIN USD 5000 @ $MARKET_PRICE

// Take profits when conditions are right
IF $PROFIT > 500 AND $CAN_DAY_TRADE THEN SELL $ALL @ $MARKET_PRICE

Understanding $REMAINING_DAY_TRADES

Returns -1 (unlimited) when:

  • Account equity is $25,000 or more
  • Account is already flagged as Pattern Day Trader

Returns 0-3 for accounts under $25k, showing remaining allowed day trades in the current rolling 5-business-day window.

Commands

DipScript provides five core commands for executing trades and managing your strategy: TICKER, OBTAIN, SELL, SET, and STOP. Think of these as the "verbs" of your trading language.

TICKER (Stock Declaration)

The TICKER command declares which stock your script trades. This must be the first line of every DipScript—it tells the system which stock symbol to monitor and trade.

// Trade Apple stock
TICKER AAPL

// Trade Tesla stock
TICKER TSLA

// Trade NVIDIA stock
TICKER NVDA

Required First Line

TICKER must always be the first non-comment line in your script. If it's missing or placed elsewhere, your script will fail validation with error code E-TKR-001.

OBTAIN (Target Position)

The OBTAIN command reaches a target position size, only buying what is needed. If you already own the target amount, nothing is purchased. If you own some shares, OBTAIN buys only the difference to reach the target. Think of it as "ensure I have this many shares."

How OBTAIN Works

  • OBTAIN 100 when you own 0 shares → buys 100 shares
  • OBTAIN 100 when you own 40 shares → buys 60 shares
  • OBTAIN 100 when you own 100+ shares → does nothing
// Ensure you have 100 shares at current market price
OBTAIN 100 @ $MARKET_PRICE

// Reach max affordable position at 2% below market (limit order)
OBTAIN $MAX @ $MARKET_PRICE - 2%

// Target 50 shares at $10 below last sell price
OBTAIN 50 @ $LAST_SELL_PRICE - 10

// Reach $5000 worth at market (buys only what's needed)
OBTAIN USD 5000

SELL (Sell Orders)

The SELL command liquidates your positions. You have precise control over quantity and exit price.

// Sell all shares immediately at market price
SELL $ALL @ $MARKET_PRICE

// Sell 100 shares at 5% above market (limit order)
SELL 100 @ $MARKET_PRICE + 5%

// Sell half your position at 15% profit
SELL $ALL / 2 @ $LAST_BUY_PRICE + 15%

// Sell at exactly $150 per share
SELL $ALL @ 150

Using $MAX with SELL

If you use $MAX in a SELL command, DipSkip automatically converts it to $ALL. This is because $MAX means "maximum shares you can afford to buy"—which doesn't make sense when selling. So SELL $MAX @ $MARKET_PRICE will sell your entire position, exactly like SELL $ALL @ $MARKET_PRICE.

SET (Variable Assignment)

The SET command creates custom variables to make your strategies more readable and maintainable. This is especially useful when you want to adjust parameters without rewriting your entire strategy.

// Set a custom buy amount
SET $BUY_AMOUNT = 600

// Set a USD investment amount for fractional shares
SET $INVESTMENT_USD = 25000

// Set profit target and stop loss levels
SET $PROFIT_TARGET = 1000
SET $STOP_LOSS = 500

// Use the variables in your logic
IF $PROFIT > $PROFIT_TARGET THEN SELL $ALL @ $MARKET_PRICE
IF $PROFIT < -$STOP_LOSS THEN SELL $ALL @ $MARKET_PRICE

STOP (Pause Script Execution)

The STOP command immediately pauses your script. When a script encounters STOP, it halts execution and changes its status to "paused." This is useful for emergency conditions or when you want to stop trading after a specific event.

// Stop script after losing more than $500
IF $PROFIT < -500 THEN STOP

// Stop after completing 10 buy trades
IF $BUY_TRADE_COUNT >= 10 THEN STOP

// Stop if market price drops too far
IF $MARKET_PRICE < 50 THEN STOP

Important

Once a script is paused via STOP, you must manually restart it from the dashboard. STOP does not sell your existing position—it simply halts further script execution. If you want to sell and stop, use SELL followed by STOP.

Decimal Precision & Value Types

DipSkip uses industry-standard decimal precision for all financial calculations. Understanding these precision levels ensures your scripts behave exactly as expected, especially when working with penny stocks or precise price targets.

Value Type Precision Examples
Stock Prices 4 decimal places $0.1899, $152.4575
Dollar Amounts
(profit, cost, cash)
2 decimal places $1,234.56, -$50.00
Share Quantities Whole numbers only 100, 50, 1
Percentages 2 decimal places 15.75%, -2.50%

Why 4 Decimals for Prices?

SEC Rule 612 allows sub-penny pricing for stocks trading under $1.00. This means penny stocks and OTC securities can have prices like $0.1875 or $0.0023. DipSkip preserves this precision to ensure accurate order execution and price comparisons.

Whole Shares Only

DipSkip currently supports whole share quantities only (no fractional shares). When you use $MAX or calculate quantities, they are always rounded down to whole numbers. For example, if you can afford 10.7 shares, DipSkip will buy 10 shares.

Tip: Market Orders

When using $MARKET_PRICE in your scripts, the order executes as a true market order. The 4-decimal precision ensures your script correctly identifies when you're trading at market price versus a specific limit price.

Comments

Comments let you add notes and explanations to your scripts. They're completely ignored during execution—the script processor removes them before running your code. Use comments to document your strategy, explain complex logic, or leave reminders for yourself.

Comment Syntax

DipScript supports two types of comments: full-line comments and inline comments. Both use the // syntax, and everything after the slashes is ignored.

Full-Line Comments

Start a line with // to make the entire line a comment:

// This is a full-line comment - the script ignores it completely
// Use these for section headers and longer explanations

TICKER NVDA

// Entry logic - buy when we have no position
IF $ALL = 0 THEN OBTAIN 100

// Exit logic - take profits at 5%
IF $PROFIT > $LAST_BUY_PRICE * 0.05 THEN SELL $ALL

Inline Comments

You can also add comments at the end of any line of code. The code before // runs normally, and everything after is ignored:

TICKER AAPL                                      // Trading Apple stock
SET $PROFIT_TARGET = 500                         // Take profit at $500
SET $STOP_LOSS = 200                             // Cut losses at $200

IF $PROFIT > $PROFIT_TARGET THEN SELL $ALL       // Exit when target hit
IF $PROFIT < -$STOP_LOSS THEN SELL $ALL      // Stop loss protection

Best Practices

  • Document your strategy: Explain the overall approach at the top of your script
  • Label sections: Use comments to separate entry, exit, and risk management logic
  • Explain magic numbers: If you use a specific value like 500, note why you chose it
  • Note assumptions: Document what market conditions your strategy assumes

Comments Don't Affect Performance

Since comments are stripped before execution, you can add as many as you like without impacting how fast your script runs. Well-commented scripts are easier to debug and modify later.

Macro Variables

DipScript supports macro variables—variables that contain expressions with other variables. When a macro variable is used, DipScript recursively resolves all nested variables until the final value is calculated. This powerful feature lets you create reusable condition shortcuts and complex expressions.

Basic Macro Syntax

Create a macro by setting a variable to an expression that contains other variables. When that variable is used later, DipScript will expand and resolve all nested variables automatically.

// Define a macro that checks if day trading is allowed
SET $CAN_DAY_TRADE = $REMAINING_DAY_TRADES > 0 OR $ACCOUNT_EQUITY >= 25000

// Define a dynamic entry price based on market conditions
SET $ENTRY_PRICE = $LAST_SELL_PRICE - 2% OR $MARKET_PRICE

// Use macros in your trading logic - variables resolve recursively
IF $LAST_BUY_PRICE = NULL AND $CAN_DAY_TRADE THEN OBTAIN USD 5000 @ $ENTRY_PRICE

How Recursive Resolution Works

Resolution Process

When DipScript encounters a variable like $CAN_DAY_TRADE, it expands to $REMAINING_DAY_TRADES > 0 OR $ACCOUNT_EQUITY >= 25000. Then it resolves $REMAINING_DAY_TRADES and $ACCOUNT_EQUITY to their actual values (e.g., 3 > 0 OR 15000 >= 25000). This continues until all variables are resolved.

Depth limit: To prevent infinite loops (e.g., if $A references $B and $B references $A), DipScript limits recursive resolution to 10 levels.

Practical Examples

Macros are especially useful for creating readable, maintainable strategies by giving meaningful names to complex conditions.

Trading Condition Macros
// Create a trailing stop condition macro
SET $TRAILING_STOP_HIT = $PROFIT > 500 AND $PROFIT < $PEAK_PROFIT - 2%

// Create a "buy the dip" condition
SET $DIP_DETECTED = $MARKET_PRICE < $PEAK_PRICE - 5%

// Create a position size macro based on account size
SET $POSITION_SIZE = $ACCOUNT_EQUITY * 10%

// Use the macros for cleaner, more readable strategies
IF $TRAILING_STOP_HIT THEN SELL $ALL @ $MARKET_PRICE
IF $DIP_DETECTED AND $ALL = 0 THEN OBTAIN USD $POSITION_SIZE

Benefits of Using Macros

  • Readability: Replace complex conditions with meaningful names like $CAN_DAY_TRADE or $DIP_DETECTED
  • Maintainability: Change a condition in one place and it applies everywhere the macro is used
  • Reusability: Define common trading patterns once and use them across multiple rules
  • Organization: Keep all your parameters and conditions at the top of your script for easy tuning

Avoid Circular References

Be careful not to create circular references where $A depends on $B and $B depends on $A. DipScript will stop resolution after 10 levels and log a warning if this occurs.

USD-Based Trading

DipScript supports USD-based orders, which let you specify a dollar amount to invest instead of a specific share count. This is useful for high-priced stocks or when you want to invest a fixed dollar amount.

Important: Rounding Behavior

DipScript does not support true fractional shares. When you specify a USD amount, DipScript calculates how many shares your dollar amount can buy at the current market price, then rounds down to the nearest whole share. For example, if $1,000 at a $95/share price equals 10.52 shares, DipScript will purchase exactly 10 shares.

When to Use USD Syntax

  • High-priced stocks: Invest $10,000 instead of calculating how many shares that buys
  • Fixed dollar amounts: Maintain consistent position sizes across different stocks
  • Dollar cost averaging: Invest the same dollar amount on a recurring schedule

USD Syntax Example

Use the USD keyword before a dollar amount to specify investment size by value instead of share count.

TICKER NVDA

// SET INVESTMENT AMOUNT IN DOLLARS
SET $BUY_AMOUNT_USD = 25000

// INITIAL PURCHASE: BUY $25,000 WORTH (ROUNDS DOWN TO WHOLE SHARES)
IF $LAST_BUY_PRICE = NULL THEN OBTAIN USD $BUY_AMOUNT_USD

// TAKE PROFIT WHEN UP $1000
IF $PROFIT > 1000 THEN SELL $ALL @ $MARKET_PRICE

// BUY THE DIP WITH ANOTHER $25,000
IF $MARKET_PRICE < $LAST_SELL_PRICE - 3% THEN OBTAIN USD $BUY_AMOUNT_USD

How It Works

When you use OBTAIN USD 5000 at a stock price of $142.50, DipScript calculates the target position: 5000 ÷ 142.50 = 35.09 shares → rounds down → targets 35 shares. Like all OBTAIN commands, it only buys what's needed to reach this target. If you already own 20 shares, it buys 15 more. If you own 35+, it does nothing.

USD Syntax Limitations

  • Rounds down: Always calculates whole shares only, fractional amounts are discarded
  • Market price only: USD orders always execute at market price (no custom limit prices)
  • OBTAIN only: The USD keyword only works with OBTAIN commands, not SELL
  • Target position: Like all OBTAIN commands, only buys what's needed to reach the target
  • Selling: To sell your position, use SELL $ALL @ $MARKET_PRICE

Conditional Logic

IF statements are the heart of your trading strategy. They define when actions happen based on market conditions, profit levels, and position data. Think of them as automated decision-making.

Comparison Operators

Use these operators to compare values and create trading conditions:

Operator Description Example
> Greater than $PROFIT > 500
< Less than $MARKET_PRICE < 150
>= Greater than or equal $PROFIT >= 1000
<= Less than or equal $ALL <= 100
= Equal to $ALL = 0
!= Not equal to $LAST_BUY_PRICE != NULL

Logical Operators

AND Logic (Combining Conditions)

Use AND when you need multiple conditions to be true before taking action. This helps create more precise entry and exit rules.

// Only buy if you have no position AND price has dropped
IF $ALL = 0 AND $MARKET_PRICE <= $LAST_SELL_PRICE - 2.5% THEN OBTAIN 400 @ $MARKET_PRICE

// Sell only when profitable AND showing weakness (trailing stop logic)
IF $PROFIT > 200 AND $PROFIT < $PEAK_PROFIT - 100 THEN SELL $ALL @ $MARKET_PRICE

// Limit position size: only add shares if below max AND price is right
IF $ALL < 500 AND $MARKET_PRICE < $LAST_BUY_PRICE - 5% THEN OBTAIN 100 @ $MARKET_PRICE

OR Logic (Fallback Values)

OR has a special purpose in DipScript: providing fallback values when variables might be NULL. This prevents your strategy from breaking when data isn't available yet.

// Use $PEAK_PROFIT if available, otherwise use 600 as the fallback
IF $PROFIT < $PEAK_PROFIT - 100 OR 600 THEN SELL $ALL @ $MARKET_PRICE

// If $LAST_SELL_PRICE doesn't exist (first run), use 100 as fallback
IF $MARKET_PRICE < $LAST_SELL_PRICE - 5% OR 100 THEN OBTAIN 50 @ $MARKET_PRICE

Important: Only One OR Per Line

DipScript allows only one OR operator per line. If you need multiple fallback conditions, split them into separate lines or use nested logic with custom variables.

This won't work:

// ERROR: Multiple OR operators not allowed
IF $A > 10 OR $B > 20 OR $C > 30 THEN ...

Do this instead: Use separate lines or combine conditions with AND where appropriate.

NULL Value Handling

Understanding NULL

Variables are NULL when they don't have a value yet. For example, $LAST_SELL_PRICE is NULL if you haven't sold anything yet. $PEAK_PROFIT is NULL before you've made any profit.

Without OR fallback: If a variable is NULL and you don't provide an OR fallback, the entire IF condition evaluates to false and won't execute.

With OR fallback: If the expression before OR results in NULL or error, DipScript uses the value after OR instead.

Comparing with NULL

When checking if a variable is NULL, you can only use = (equals) or != (not equals). Other comparison operators like >, <, >=, <= don't work with NULL and will cause unexpected behavior.

Correct: IF $LAST_BUY_PRICE = NULL THEN ...

Correct: IF $LAST_BUY_PRICE != NULL THEN ...

Avoid: IF $LAST_BUY_PRICE > NULL THEN ... (won't work as expected)

NULL in Practice
// Check if you've never bought before (NULL means never traded)
IF $LAST_BUY_PRICE = NULL THEN OBTAIN 100 @ $MARKET_PRICE

// Check if you've sold before (not NULL means you have)
IF $LAST_SELL_PRICE != NULL THEN OBTAIN 50 @ $MARKET_PRICE

Math Operations & Smart Percentages

DipScript supports mathematical expressions for dynamic pricing strategies. One of the most powerful features is the "smart percentage" system that automatically calculates percentage changes.

Basic Math Operations

Operator Description Example
+ Addition $MARKET_PRICE + 10
- Subtraction $PROFIT - 100
* Multiplication $MAX * 0.5
/ Division $ALL / 2

Smart Percentage System

This is where DipScript really shines. When you use a percentage with addition or subtraction, DipScript automatically applies it to the base value. You don't have to calculate anything manually.

How Smart Percentages Work

When you write $MARKET_PRICE - 5%, DipScript automatically means:

"Take the market price and subtract 5% OF the market price"

It's multiplicative, not literal. The percentage is always calculated from the base value before the operator.

Percentage Calculations Explained
Assume a stock's current market price is $100. Here's how percentages work:
  • $MARKET_PRICE - 5% = $95
    Calculation: 100 - (5% of 100) = 100 - 5 = 95
  • $MARKET_PRICE + 10% = $110
    Calculation: 100 + (10% of 100) = 100 + 10 = 110
  • $MARKET_PRICE - 2.5% = $97.50
    Calculation: 100 - (2.5% of 100) = 100 - 2.5 = 97.50
  • $LAST_BUY_PRICE + 15% (if last buy was $80) = $92
    Calculation: 80 + (15% of 80) = 80 + 12 = 92

Practical Percentage Applications

Smart percentages make complex strategies simple to write:

// Buy at 2% below current market price
OBTAIN 100 @ $MARKET_PRICE - 2%

// Sell at 5% above current market price
SELL $ALL @ $MARKET_PRICE + 5%

// Buy when price drops 10% below last sell
IF $MARKET_PRICE <= $LAST_SELL_PRICE - 10% THEN OBTAIN 200 @ $MARKET_PRICE

// Take profit at 20% gain from buy price
IF $MARKET_PRICE >= $LAST_BUY_PRICE + 20% THEN SELL $ALL @ $MARKET_PRICE

// Combine percentage and fixed amount: 5% below market plus $1.25
OBTAIN 50 @ $MARKET_PRICE - 5% + 1.25

Calculating Profit Percentages

Since DipScript uses dollar-based profit variables, you can calculate percentage gains by comparing profit to investment:

// Sell when profit exceeds 20% of invested amount
// This means: profit > (invested * 20%)
IF $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE * 20% THEN SELL $ALL @ $MARKET_PRICE

// Stop loss when down 10% of invested amount
IF $PROFIT < $AMOUNT_INVESTED_SINCE_LAST_TRADE * -10% THEN SELL $ALL @ $MARKET_PRICE

// Check if total profit exceeds 15% of total invested
IF $TOTAL_PROFIT > $TOTAL_AMOUNT_INVESTED * 15% THEN SELL $ALL @ $MARKET_PRICE

Warning: Never Use Standalone Percentages in Comparisons

A standalone percentage like 5% evaluates to 0.05, not 5% of something! Percentages only become "smart" when preceded by +, -, or *.

WRONG:

// This means "$PROFIT > 0.05" (5 cents!) - ALWAYS TRUE!
IF $PROFIT > 5% THEN SELL $ALL @ $MARKET_PRICE

CORRECT:

// Take profit when gain exceeds 5% of investment
IF $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE * 5% THEN SELL $ALL @ $MARKET_PRICE

When comparing dollar values (like $PROFIT) to a percentage, always use * X% to calculate X% of another value.

Day Trading with DipScript

Day trading is all about speed, precision, and discipline. You're making multiple trades within a single day, trying to profit from small price movements. DipScript automates the execution so you can focus on strategy instead of manually placing orders.

Why Automation Matters for Day Trading

Day trading windows are small. A stock might spike for 30 seconds before reversing. By the time you manually calculate your profit, decide to sell, and place the order, the opportunity is gone. DipScript executes in milliseconds.

Classic Day Trading Scenario
You're trading a volatile tech stock. You want to buy dips and sell rallies repeatedly throughout the day:
TICKER TSLA

// Initial entry: buy if we have no position
IF $ALL = 0 AND $LAST_BUY_PRICE = NULL THEN OBTAIN 100 @ $MARKET_PRICE

// Quick profit taking: sell when up $300
IF $PROFIT > 300 THEN SELL $ALL @ $MARKET_PRICE

// Re-entry: buy the dip after selling (if price drops 1.5%)
IF $ALL = 0 AND $MARKET_PRICE <= $LAST_SELL_PRICE - 1.5% THEN OBTAIN 100 @ $MARKET_PRICE

// Safety stop: cut losses if down $150
IF $PROFIT < -150 THEN SELL $ALL @ $MARKET_PRICE

This strategy will automatically cycle through buying and selling all day long, capturing $300 profits and limiting losses to $150. No manual intervention needed.

Key Day Trading Principles

  • Have a Plan: Know your entry, exit, and stop loss before the market opens
  • Risk Management: Always set stop losses. Protect your capital first
  • Take Profits: Don't get greedy. Small consistent wins compound
  • Limit Exposure: Don't hold positions overnight if you're day trading
  • Volume Matters: Day trade liquid stocks with high volume for better execution

Scalping Strategies

Scalping is high-frequency day trading. You're making dozens or hundreds of trades, capturing tiny profit margins on each. This requires automation—no human can execute scalping strategies manually at scale.

What is Scalping?

Scalpers aim for small profits per trade (often $50-$200) but make many trades. If you make 20 trades per day averaging $100 profit each, that's $2,000 daily. DipScript is perfect for this because it executes instantly when your profit targets hit.

Basic Scalping Strategy
Target $100 profits with tight $50 stop losses, cycling in and out rapidly:
TICKER SPY

// Configuration
SET $POSITION_SIZE = 200
SET $PROFIT_TARGET = 100
SET $STOP_LOSS = 50

// Entry: buy when flat
IF $ALL = 0 THEN OBTAIN $POSITION_SIZE @ $MARKET_PRICE

// Take profit at target
IF $PROFIT >= $PROFIT_TARGET THEN SELL $ALL @ $MARKET_PRICE

// Stop loss at limit
IF $PROFIT <= -$STOP_LOSS THEN SELL $ALL @ $MARKET_PRICE

This strategy immediately re-enters after every exit, running continuously. With a 2:1 profit-to-loss ratio, you only need to win 34% of trades to break even. Anything above that is profit.

Advanced Scalping: Pyramiding Profits

As you build profit, you can take partial exits to lock in gains while leaving some position to run:

TICKER QQQ

// Enter with 300 shares
IF $ALL = 0 THEN OBTAIN 300 @ $MARKET_PRICE

// Sell 1/3 when up $100 (lock in some profit)
IF $PROFIT >= 100 AND $SELL_TRADE_COUNT = 0 THEN SELL 100 @ $MARKET_PRICE

// Sell another 1/3 when up $200
IF $PROFIT >= 200 AND $SELL_TRADE_COUNT = 1 THEN SELL 100 @ $MARKET_PRICE

// Let the final 1/3 run to $300 or trailing stop
IF $PROFIT >= 300 THEN SELL $ALL @ $MARKET_PRICE

// Trailing stop: protect profits if price reverses
IF $PROFIT < $PEAK_PROFIT - 75 THEN SELL $ALL @ $MARKET_PRICE

// Hard stop: maximum loss limit
IF $PROFIT < -60 THEN SELL $ALL @ $MARKET_PRICE

Momentum Trading

Momentum trading captures sustained price moves. Instead of quick scalps, you're riding trends that might last hours or days. DipScript helps you enter breakouts automatically and protect profits with trailing stops.

Momentum Trading Principles

  • Trend is Your Friend: Only trade in the direction of strong moves
  • Breakouts: Enter when price breaks above resistance or below support
  • Trailing Stops: Let profits run but protect against reversals
  • Volume Confirmation: Strong momentum comes with high volume
Breakout Momentum Strategy
Enter on upward breakouts and ride the momentum with trailing stop protection:
TICKER NVDA

// Enter when price breaks above recent peak by 2%
IF $ALL = 0 AND $MARKET_PRICE > $PEAK_PRICE + 2% THEN OBTAIN 150 @ $MARKET_PRICE

// Add to position on continued strength (pyramiding)
IF $ALL > 0 AND $ALL < 300 AND $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE * 5% THEN OBTAIN 75 @ $MARKET_PRICE

// Trailing stop: exit if profit drops 8% from peak
IF $PROFIT > 0 AND $PROFIT <= $PEAK_PROFIT - $PEAK_PROFIT * 8% THEN SELL $ALL @ $MARKET_PRICE

// Hard stop: cut losses at 10% down
IF $PROFIT < $AMOUNT_INVESTED_SINCE_LAST_TRADE * -10% THEN SELL $ALL @ $MARKET_PRICE

This strategy waits for confirmation of upward momentum before entering, adds to winning positions, and uses a percentage-based trailing stop to lock in profits as the trend continues.

Risk Management

Risk management is what separates profitable traders from those who blow up their accounts. No matter how good your strategy is, you need rules to protect your capital.

Essential Risk Controls

1. Always Use Stop Losses

Every strategy should have a maximum loss limit. Never let a losing trade run indefinitely.

// Fixed dollar stop loss
IF $PROFIT < -500 THEN SELL $ALL @ $MARKET_PRICE

// Percentage-based stop loss (10% of investment)
IF $PROFIT < $AMOUNT_INVESTED_SINCE_LAST_TRADE * -10% THEN SELL $ALL @ $MARKET_PRICE

2. Position Sizing

Don't put all your capital into a single trade. Limit position sizes to manage risk.

// Use 25% of available capital instead of maximum
IF $ALL = 0 THEN OBTAIN $MAX / 4 @ $MARKET_PRICE

// Or use a fixed maximum position size
SET $MAX_POSITION = 200
IF $ALL = 0 THEN OBTAIN $MAX_POSITION @ $MARKET_PRICE

3. Limit Number of Trades

Prevent overtrading by capping how many times you can enter a position.

// Only allow 5 buy trades total
IF $BUY_TRADE_COUNT < 5 AND $ALL = 0 THEN OBTAIN 100 @ $MARKET_PRICE

4. Profit Protection with Trailing Stops

Once profitable, use trailing stops to lock in gains while allowing for continued upside.

// Once up $200, exit if profit drops by $100 from peak
IF $PROFIT > 200 AND $PROFIT < $PEAK_PROFIT - 100 THEN SELL $ALL @ $MARKET_PRICE

Complete Risk-Managed Strategy Example

TICKER AAPL

// Configuration: all risk parameters in one place
SET $POSITION_SIZE = 100
SET $PROFIT_TARGET = 500
SET $STOP_LOSS = 250
SET $MAX_TRADES = 10

// Entry with trade limit
IF $ALL = 0 AND $BUY_TRADE_COUNT < $MAX_TRADES THEN OBTAIN $POSITION_SIZE @ $MARKET_PRICE

// Profit taking
IF $PROFIT >= $PROFIT_TARGET THEN SELL $ALL @ $MARKET_PRICE

// Stop loss
IF $PROFIT <= -$STOP_LOSS THEN SELL $ALL @ $MARKET_PRICE

// Trailing stop: protect profits once up $300
IF $PROFIT > 300 AND $PROFIT < $PEAK_PROFIT - 150 THEN SELL $ALL @ $MARKET_PRICE

Risk Management Reality Check

Even with perfect execution, trading involves risk. DipScript helps you stick to your rules, but it can't eliminate market risk. Only risk capital you can afford to lose. Consider starting with paper trading or small positions to test strategies before scaling up.

Common Patterns

These patterns form the building blocks of most trading strategies. Mix and match them to create your custom approach.

Entry Strategies

// Initial position entry (first time buying)
IF $LAST_BUY_PRICE = NULL THEN OBTAIN 100 @ $MARKET_PRICE

// Dollar cost averaging (buy more on dips)
IF $MARKET_PRICE <= $LAST_BUY_PRICE - 5% THEN OBTAIN 50 @ $MARKET_PRICE

// Breakout buying (enter on strength)
IF $MARKET_PRICE > $PEAK_PRICE + 3% THEN OBTAIN 100 @ $MARKET_PRICE

// Dip buying after selling (buy back cheaper)
IF $ALL = 0 AND $MARKET_PRICE <= $LAST_SELL_PRICE - 2% THEN OBTAIN 200 @ $MARKET_PRICE

Exit Strategies

// Fixed dollar profit target
IF $PROFIT >= 1000 THEN SELL $ALL @ $MARKET_PRICE

// Percentage-based profit target (20% gain)
IF $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE * 20% THEN SELL $ALL @ $MARKET_PRICE

// Fixed dollar stop loss
IF $PROFIT <= -500 THEN SELL $ALL @ $MARKET_PRICE

// Trailing stop (exit if profit drops from peak)
IF $PROFIT <= $PEAK_PROFIT - 200 THEN SELL $ALL @ $MARKET_PRICE

// Partial exit (take some profit, let rest run)
IF $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE * 10% THEN SELL $ALL / 2 @ $MARKET_PRICE

Position Management

// Position sizing based on available capital (use 25%)
IF $ALL = 0 THEN OBTAIN $MAX / 4 @ $MARKET_PRICE

// Limit number of buy transactions
IF $BUY_TRADE_COUNT < 3 AND $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE * 5% THEN OBTAIN 50 @ $MARKET_PRICE

// Scale out in portions (tiered exits)
IF $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE * 20% AND $SELL_TRADE_COUNT = 0 THEN SELL $ALL / 3 @ $MARKET_PRICE

Strategy Examples

Complete strategy implementations demonstrating different trading approaches. Use these as templates and customize to fit your style.

Conservative Dollar Cost Averaging

A risk-managed approach that accumulates shares on dips and takes profits systematically. Perfect for less volatile stocks and longer-term holds.
TICKER AAPL

// Initial purchase
IF $LAST_BUY_PRICE = NULL THEN OBTAIN 50 @ $MARKET_PRICE

// Add to position on 5% dips (dollar cost averaging)
IF $ALL > 0 AND $MARKET_PRICE <= $LAST_BUY_PRICE - 5% THEN OBTAIN 25 @ $MARKET_PRICE

// Take profit at 20% gain
IF $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE * 20% THEN SELL $ALL @ $MARKET_PRICE

// Stop loss at 15% down
IF $PROFIT < $AMOUNT_INVESTED_SINCE_LAST_TRADE * -15% THEN SELL $ALL @ $MARKET_PRICE

Momentum Breakout Strategy

Captures upward momentum with trailing stop protection. Ideal for volatile tech stocks with strong trends.
TICKER TSLA

// Enter on breakout above recent high
IF $ALL = 0 AND $MARKET_PRICE > $PEAK_PRICE + 2% THEN OBTAIN 100 @ $MARKET_PRICE

// Add to position on continued momentum (pyramiding)
IF $ALL > 0 AND $ALL < 200 AND $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE * 5% THEN OBTAIN 50 @ $MARKET_PRICE

// Trailing stop: sell if profit drops 8% from peak
IF $PROFIT > 0 AND $PROFIT <= $PEAK_PROFIT - $PEAK_PROFIT * 8% THEN SELL $ALL @ $MARKET_PRICE

// Hard stop loss at 12%
IF $PROFIT < $AMOUNT_INVESTED_SINCE_LAST_TRADE * -12% THEN SELL $ALL @ $MARKET_PRICE

Best Practices

Guidelines for writing effective and maintainable DipScript strategies that perform well in real trading conditions.

Strategy Design

  • Start Simple: Begin with basic buy/sell rules and add complexity gradually as you understand performance
  • Define Clear Entry/Exit Rules: Every strategy should have explicit conditions for entering and exiting positions
  • Include Risk Management: Always implement stop losses and position limits before going live
  • Test Edge Cases: Consider NULL values, first trades, and extreme market conditions in your logic
  • Use Variables for Parameters: SET commands make it easy to adjust profit targets and stop losses
  • Comment Your Code: Future you will thank present you for explaining complex logic

Important Risk Considerations

Always include appropriate risk controls in your strategies. Consider position sizing, stop losses, maximum drawdown limits, and trade count limits when designing strategies. Never risk more than you can afford to lose on a single trade or strategy.

Well-Structured Strategy Template
A template demonstrating good organization and risk management practices:
TICKER QQQ

// ============================================
// STRATEGY PARAMETERS (adjust these as needed)
// ============================================
SET $POSITION_SIZE = 200
SET $PROFIT_TARGET = 800
SET $STOP_LOSS = 400
SET $TRAILING_STOP = 150

// ============================================
// ENTRY LOGIC
// ============================================
IF $LAST_BUY_PRICE = NULL THEN OBTAIN $POSITION_SIZE @ $MARKET_PRICE

// ============================================
// RISK MANAGEMENT - STOP LOSS (most important!)
// ============================================
IF $PROFIT <= -$STOP_LOSS THEN SELL $ALL @ $MARKET_PRICE

// ============================================
// PROFIT TAKING
// ============================================
IF $PROFIT >= $PROFIT_TARGET THEN SELL $ALL @ $MARKET_PRICE

// Trailing stop once profitable
IF $PROFIT > 200 AND $PROFIT < $PEAK_PROFIT - $TRAILING_STOP THEN SELL $ALL @ $MARKET_PRICE

// ============================================
// RE-ENTRY LOGIC
// ============================================
IF $ALL = 0 AND $MARKET_PRICE <= $LAST_SELL_PRICE - 3% THEN OBTAIN $POSITION_SIZE @ $MARKET_PRICE

Testing and Validation

  • Paper Trade First: Test strategies with virtual money before risking real capital
  • Start Small: When going live, start with smaller position sizes
  • Monitor Closely: Watch your first few trades execute to ensure logic works as expected
  • Keep Records: Track what strategies work and what doesn't

Order Execution

Understanding how DipSkip executes and tracks your stock orders is essential for building reliable trading strategies.

Order Lifecycle

When your DipScript triggers a buy or sell order, the following process occurs:

Order Execution Flow

  1. Order Submission: Your order is submitted to the broker (Tradier)
  2. Synchronous Waiting: The script waits for the order to fill, polling every 5 seconds
  3. If Filled: Order details are recorded and your script variables are updated immediately
  4. If Timeout Reached: The order is cancelled and the script continues execution
  5. If Cancel Fails: The script is paused and you receive an email notification

Pending Order Detection

DipScripts run on a continuous loop. The execution frequency depends on your subscription tier. If an order is still pending when your script runs again, the system automatically detects this and prevents duplicate orders from being placed.

  • Buy Orders: If a pending buy order exists for the ticker, new buy orders are blocked
  • Sell Orders: Anti-shorting protection prevents selling more shares than you own minus any pending sell quantity

Order Timeouts

You can configure how long the system waits for an order to fill before cancelling it. This setting is found in the Settings tab under "Order Fill Timeout".

  • Range: 1 to 5 minutes
  • Default: 5 minutes

If the timeout is reached, the system attempts to cancel the order with retry logic (up to 10 attempts). If cancellation succeeds, the script continues. If cancellation fails after all retries, the script is paused and you receive an email notification requiring manual intervention.

Partial Fills at Timeout

If your order is partially filled when the timeout occurs (for example, you ordered 100 shares but only 60 filled), DipSkip will:

  • Cancel the remaining unfilled portion (40 shares in this example)
  • Keep the shares that did fill—they're now part of your position
  • Update your script variables to reflect the partial fill

Your script will continue running with the shares you received. On the next execution cycle, it may place another order if your entry conditions are still met.

Important: Limit Orders

The timeout applies to all orders. If you're using limit orders that may take longer to fill, be aware they will be cancelled if not filled within your configured timeout. For longer-term limit orders, consider managing them directly through your broker.

Tradier Connection

DipSkip uses Tradier as the brokerage connection for executing trades. Tradier is a modern, API-first brokerage that provides commission-free stock and ETF trading, making it ideal for automated trading strategies.

Creating a Tradier Account

Before connecting DipSkip to your brokerage, you'll need to create a Tradier account:

  1. Visit tradier.com and click Open an Account
  2. Select Individual Brokerage Account as your account type
  3. Complete the application with your personal information, including:
    • Full legal name and contact information
    • Social Security Number (required for tax reporting)
    • Employment information
    • Investment experience and objectives
  4. Review and sign the account agreements electronically
  5. Fund your account via bank transfer (ACH), wire transfer, or account transfer

Account Approval

Tradier approves accounts within 1-2 business days according to their documentation. You'll receive an email confirmation once your account is ready for trading.

Connecting Your Tradier Account to DipSkip

Once your Tradier account is approved and funded, you can connect it to DipSkip:

  1. Log in to DipSkip and navigate to the User tab in the sidebar
  2. In the Account Setup section, locate the Trading Connection card
  3. Click the Connect button to initiate the OAuth connection
  4. You'll be redirected to Tradier's secure login page
  5. Enter your Tradier credentials and authorize DipSkip to access your account
  6. After authorization, you'll be redirected back to DipSkip with a Connected status
Account Setup showing Trading Connection and Terms Agreement

The Account Setup section shows your connection status. Once connected, you'll see a green Connected badge. You can disconnect at any time by clicking the Disconnect button.

Terms Agreement Required

Before you can run trading scripts, you must also accept the DipSkip Terms of Service by clicking Accept Terms in the Terms Agreement card. Both the trading connection and terms agreement must be completed to activate your account.

Paper Trading Mode

DipSkip supports paper trading (simulated trading) so you can test your strategies without risking real money. Toggle paper trading mode in the Settings tab. When enabled, all trades are simulated using real market data but no actual orders are placed.

Realistic Order Simulation

Paper trading is designed to closely mirror live Tradier trading behavior while keeping order execution fast for testing. Orders fill immediately but include realistic price adjustments.

Price Slippage

Market orders include realistic slippage simulation to mimic the bid-ask spread:

  • Buy orders: Fill at slightly higher than the quoted price (up to +0.1%)
  • Sell orders: Fill at slightly lower than the quoted price (up to -0.1%)

This means your Avg Fill Price (shown in Portfolio) may differ from the Current Price. This is intentional and reflects real-world trading conditions where market orders execute at the best available price, not the exact quoted price.

Example: If you buy 100 shares when the price is $50.00, you might fill at $50.05 due to slippage. Your position will immediately show a small loss until the market price rises above your fill price.

Pattern Day Trader (PDT) Rules

Paper trading enforces PDT rules just like live trading:

  • Day trades are tracked using the 5-business-day rolling window
  • 4+ day trades triggers PDT status
  • PDT accounts require $25,000 minimum equity to continue day trading

Margin Account for Day Trading

By default, Tradier accounts are set up as cash accounts. While cash accounts work fine for swing trading and longer-term strategies, they have a significant limitation for day trading: trade settlement.

Understanding Trade Settlement

When you sell a stock in a cash account, the funds from that sale take T+1 (one business day) to settle. Until the funds settle, you cannot use them to make new purchases. This means:

  • If you buy and sell a stock on Monday, those funds aren't available until Tuesday
  • Attempting to use unsettled funds results in a Good Faith Violation
  • Multiple violations can result in account restrictions

Why You Need a Margin Account

A margin account eliminates the settlement waiting period. With margin:

  • Funds are immediately available after selling a position
  • You can execute multiple round-trip trades in a single day
  • No Good Faith Violations for using proceeds from recent sales

Margin ≠ Borrowing

Having a margin account doesn't mean you have to trade on borrowed money. You can still trade using only your own cash—the margin account simply removes the settlement delay. DipSkip's default behavior uses only your available cash balance.

Applying for Margin on Tradier

To upgrade your Tradier cash account to a margin account:

  1. Log in to your account at dash.tradier.com
  2. Navigate to AccountSettings or Account Features
  3. Look for Margin Trading or Account Upgrade options
  4. Complete the margin application, which includes:
    • Acknowledging the risks of margin trading
    • Confirming your investment experience
    • Signing the margin agreement
  5. Wait for approval (1-2 business days according to Tradier)

Pattern Day Trader Rule

If you execute 4 or more day trades within 5 business days, you may be classified as a Pattern Day Trader (PDT). PDT accounts require a minimum equity of $25,000. If your account falls below this threshold, day trading may be restricted until you deposit additional funds. DipSkip tracks your day trade count in the Settings tab to help you stay aware of this limit.

Alternative: Paper Trading

If you want to practice day trading strategies without margin requirements or PDT restrictions, use DipSkip's paper trading mode. Paper trading simulates real market conditions without any of the regulatory limitations, making it perfect for strategy development and testing.

Fingerprint Login

DipSkip uses Google Sign-In for authentication, which means you can take advantage of Google's Passkeys feature to log in using your fingerprint or Face ID instead of typing your password every time.

What are Passkeys?

Passkeys are a modern, more secure alternative to passwords. Instead of remembering and typing a password, you authenticate using your device's biometrics (fingerprint or face recognition). Passkeys are:

  • More Secure: Cannot be phished or stolen like passwords
  • Faster: Just touch your fingerprint sensor or look at your phone
  • Convenient: No passwords to remember or type

Setting Up Fingerprint Login

To enable fingerprint login for DipSkip, you need to set up a passkey on your Google account:

  1. Visit myaccount.google.com on your phone or computer
  2. Sign in to your Google account if prompted
  3. Navigate to Security in the left sidebar
  4. Scroll down to find Passkeys (under "How you sign in to Google")
  5. Click Create a passkey
  6. Follow the prompts to register your device's biometric (fingerprint or Face ID)
  7. Your passkey is now set up!

Device Requirements

Passkeys work on most modern devices with biometric sensors:

  • iPhone: Touch ID or Face ID (iOS 16+)
  • Android: Fingerprint sensor (Android 9+)
  • Mac: Touch ID on MacBook Pro/Air
  • Windows: Windows Hello (fingerprint or facial recognition)

Using Fingerprint Login on DipSkip

Once you've set up a passkey on your Google account, logging into DipSkip becomes seamless:

  1. Open DipSkip and tap Sign in with Google
  2. Google will detect your passkey and prompt for biometric verification
  3. Touch your fingerprint sensor or use Face ID
  4. You're logged in! No password required

Works on Mobile Too

Fingerprint login works great on the DipSkip mobile site. Just tap "Sign in with Google" and authenticate with your fingerprint—perfect for quick access to check your trades on the go.

Troubleshooting

If fingerprint login isn't working:

  • Passkey not showing up: Make sure you created the passkey on the same device you're trying to sign in from
  • Fingerprint not recognized: Try re-registering your fingerprint in your device's settings
  • Browser issues: Passkeys work best in Chrome, Safari, and Edge. Firefox support is limited
  • Still prompted for password: You can always fall back to password login if needed—passkeys are optional

Price Chart

The dashboard displays an interactive price chart for each of your running scripts, providing real-time visualization of price movements and key reference points. Understanding what each element represents helps you monitor your strategy's performance at a glance.

Dashboard Price Chart

Price Line

The main blue line shows the stock's price movement over time. The chart automatically scales to show recent price action and updates in real-time during market hours. Hover over any point to see the exact price and timestamp.

Reference Lines

Three horizontal reference lines help you understand your position relative to key price levels:

  • Buy Line (Green): Shows the price at which you entered your current position. This appears when your last executed order was a buy. The line is labeled "Buy" with the exact price on the right axis.
  • Sell Line (Red): Shows the price at which you exited your last position. This appears when your last executed order was a sell. The line is labeled "Sell" with the exact price on the right axis.
  • Peak Line (Orange): Tracks the highest price reached since your last buy. The label shows the percentage above your entry price, e.g., "Peak (+0.5%)" means the peak is 0.5% higher than your buy price. This resets each time you make a new purchase.
  • Low Line (Purple): Tracks the lowest price reached since your last sell. The label shows the percentage below your sell price, e.g., "Low (-2.6%)" means the low is 2.6% below your sell price. This resets each time you sell.

Trade Markers

When trades execute, markers appear on the chart at the exact time and price:

  • B (Green): Buy order executed at this point
  • S (Red): Sell order executed at this point

Using the Chart Effectively

The percentage indicators on Peak and Low lines are especially useful for evaluating your strategy's performance:

  • A high Peak percentage shows the maximum potential profit you could have captured
  • Comparing Peak to current price shows how much profit has been given back
  • The Low percentage helps evaluate whether your entry points are timing dips correctly
  • Wide gaps between Peak and Low indicate high volatility—adjust your strategy accordingly

Script Metrics

Adjacent to the price chart, the dashboard displays real-time metrics for each running script. These statistics update automatically and provide a comprehensive view of your strategy's current state and historical performance.

Profit Metrics

  • Current Total Profit: Your overall profit/loss combining both realized gains from completed trades and unrealized gains from open positions. Displayed in dollars and as a percentage of your invested capital.
  • Current Running Profit: The unrealized profit/loss on your currently held shares. This fluctuates with the market price and becomes realized when you sell.
  • Total Realized Profit: The sum of all profits and losses from completed trades. This only changes when you actually sell shares and lock in gains or losses.

Position Information

  • Stocks Owned: The number of shares you currently hold in this position. Shows 0 when you have no open position.
  • Buy Trade Count: Total number of buy orders executed by this script since it started running. Useful for understanding how active your strategy is.
  • Sell Trade Count: Total number of sell orders executed by this script. Comparing buy and sell counts helps you understand position cycling frequency.

Executed Orders

Below the metrics, a table shows your recent order history for this script:

  • Timestamp: Exact date and time the order was filled
  • Type: Whether the order was a buy or sell
  • QTY: Number of shares traded
  • Avg Fill Price: The actual price at which the order executed
  • Profit: For sell orders, the profit or loss realized on that trade

Monitoring Multiple Scripts

If you're running multiple scripts on different tickers, each one has its own independent chart and metrics panel. Scroll through your dashboard to monitor all active strategies, or use the script selector to focus on a specific one.

Alerts Overview

DipSkip's alerts system keeps you informed about important events without requiring you to constantly monitor the dashboard. Set up email notifications for price movements, profit/loss thresholds, and trade executions so you can stay on top of your strategies wherever you are.

Why Use Alerts?

While your scripts run autonomously, there are times when you want to know immediately about specific events:

  • A stock you're watching hits your target entry price
  • Your script executes a trade (buy or sell)
  • Your position reaches a profit target or loss limit
  • Market conditions trigger unusual activity in your strategy

Alerts bridge the gap between full automation and staying informed. You get the convenience of hands-off trading with the awareness of real-time notifications.

Email Delivery

All alerts are delivered via email to the address associated with your account. Make sure your email settings are correct in your account profile to receive notifications.

Alert Types

DipSkip supports five different alert types, each designed for specific monitoring needs. You can create multiple alerts of each type with different configurations.

Symbol Price Alert

Get notified when any stock reaches a specific price point. This alert type is independent of your scripts and monitors the market directly.

  • Symbol: The stock ticker to watch (e.g., AAPL, NVDA, TSLA)
  • Target Price: The price that triggers the alert

Use case: Set a symbol price alert for a stock you want to buy when it drops to a certain level, or to notify you when a watched stock breaks through resistance.

Loss Amount Alert

Receive a notification when the current loss on selected scripts reaches a threshold. You can set the threshold in either dollar amount or percentage terms.

  • Amount: The loss value that triggers the alert
  • Type: Choose between USD (e.g., -$50) or Percent (e.g., -5%)
  • Scripts: Select which scripts to monitor for this alert

Use case: Set a loss alert at -10% to know immediately if a position moves significantly against you, giving you time to review and potentially intervene.

Gain Amount Alert

Get notified when the current profit on selected scripts reaches a target level. Configure in dollar amount or percentage.

  • Amount: The profit value that triggers the alert
  • Type: Choose between USD (e.g., $100) or Percent (e.g., +10%)
  • Scripts: Select which scripts to monitor for this alert

Use case: Set a gain alert at +15% to celebrate hitting your target, or to consider taking partial profits manually.

Buy Trades Alert

Receive notifications when your scripts execute buy orders. Configure to alert on every buy or only after a certain number of buys.

  • Every Trade: Get notified on every single buy execution
  • After X Trades: Only alert after a specific number of buys (useful for averaging-down strategies)
  • Scripts: Select which scripts to monitor

Use case: If your script averages down on dips, set an alert after 3 buys to know when multiple entries have occurred, signaling either opportunity or caution.

Sell Trades Alert

Receive notifications when your scripts execute sell orders. Similar to buy alerts, configure for every sell or after a threshold.

  • Every Trade: Get notified on every single sell execution
  • After X Trades: Only alert after a specific number of sells
  • Scripts: Select which scripts to monitor

Use case: Set sell alerts to "every trade" so you know immediately when your script locks in profits or cuts losses.

Alert Frequency

Be mindful when setting "every trade" alerts on high-frequency strategies. If your script trades frequently, you may receive many emails. Consider using the "after X trades" option for busy strategies.

Managing Alerts

Access the Alerts tab from the main navigation to view, create, edit, and delete your alerts.

Creating an Alert

  1. Navigate to the Alerts tab
  2. Select the alert type from the dropdown menu
  3. Fill in the required fields based on the alert type
  4. For script-based alerts, select one or more scripts to monitor
  5. Click Add Alert to save

Editing an Alert

To modify an existing alert, click the Edit button next to the alert in your alerts list. Update the fields as needed and click Update Alert to save your changes.

Deleting an Alert

Click the Delete button next to any alert to remove it. You'll be asked to confirm before the alert is permanently deleted.

Alert Status

Each alert shows its current configuration in the alerts list, including:

  • Alert type and trigger conditions
  • Associated scripts (for script-based alerts)
  • Current status (active/triggered)

Combining Alerts with Script Logic

Alerts work alongside your scripts, not instead of them. Use alerts for awareness while letting your scripts handle the actual trading logic. For example, your script might have a stop-loss at -15%, but you could set a loss alert at -10% to give yourself early warning.

Backtesting Overview

The Backtester tab allows you to test your DipScript strategies against historical price data before risking real capital. By simulating how your script would have performed in the past, you can validate your logic, fine-tune parameters, and build confidence in your approach.

Why Backtest?

Every trading strategy looks good in theory, but backtesting reveals the truth. Before going live, you should know:

  • Would this strategy have been profitable over a given time period?
  • What's the maximum drawdown I should expect?
  • How frequently does my script execute trades?
  • Are my profit targets and stop losses calibrated correctly?

The backtester runs your exact DipScript logic against price data, simulating every trade as if it happened in real-time. The same script you test is the same script you deploy.

Backtester Workflow

  1. Load price data - Upload historical CSV data or generate synthetic prices
  2. Select a script - Choose which DipScript to test from your saved scripts
  3. Run the backtest - Execute the simulation and view results
  4. Analyze performance - Review metrics, trade history, and visualizations
  5. Iterate - Adjust your script and test again until satisfied

Loading Price Data

The backtester needs price data to simulate against. You have two options: upload your own historical data or generate synthetic price movements.

Backtester Data Input

Option 1: Upload CSV Data

If you have historical price data from Yahoo Finance, your broker, or another source, you can upload it directly. Click Choose CSV File and select your data file. The backtester supports multiple CSV formats:

  • Date,Price - Simple daily closing prices
  • Timestamp,Price - Intraday data with timestamps
  • OHLCV - Full candlestick data (Open, High, Low, Close, Volume)

Option 2: Generate Synthetic Data

Don't have historical data? The Data Generator creates realistic price movements based on parameters you control. This is useful for stress-testing strategies against specific market conditions.

Generator Parameters

  • Starting Price ($): The initial stock price when the simulation begins.
  • Target End Price ($): The approximate ending price. The generator will trend toward this value over time, though volatility means it won't hit exactly.
  • Volatility (%): How much daily price fluctuation to simulate. Typical stocks range from 1-10%. Higher values create more dramatic swings.
  • Trend Strength: How strongly prices trend vs. random walk. Set to 0 for pure random movement, 1 for strong directional trend.
  • Number of Data Points: How many price observations to generate. 252 points equals roughly one trading year of daily data.
  • Initial Cash ($): Your simulated starting capital for the backtest.
  • Prices to Hit (Optional): Comma-separated price levels you want the simulation to reach. Useful for testing how your script handles specific price targets.

Click Generate Chart to create the price data and visualize it. Click Export CSV if you want to save the generated data for later use.

Running a Backtest

Once your price data is loaded, you'll see an interactive chart showing the full price history along with key statistics about the data.

Generated Price Chart

Data Statistics

Below the chart, summary statistics help you understand the data you're testing against:

  • Data Points: Total number of price observations in the dataset
  • Start Price: The opening price at the beginning of the period
  • End Price: The closing price at the end of the period
  • Total Change: Overall percentage gain or loss across the entire period
  • Highest Price: The maximum price reached during the simulation
  • Lowest Price: The minimum price reached during the simulation

Selecting and Running Your Script

Use the Select Script dropdown at the top of the chart to choose which of your saved DipScripts you want to test. The dropdown shows all scripts from your repository.

Once selected, click Run Script to execute the backtest. The system will simulate your script running against every price point in the data, executing trades exactly as it would in live trading.

Backtest Execution

The backtester processes each price point sequentially, evaluating your script's conditions against the current simulated market state. All variables like $PROFIT, $PEAK_PRICE, and $LAST_BUY_PRICE update exactly as they would during live trading.

Analyzing Results

After the backtest completes, you'll see comprehensive results showing exactly how your strategy performed.

Backtest Results

Performance Metrics

The results panel displays key performance indicators:

  • Total Return: Your overall profit or loss in dollars. This is the bottom line - how much money the strategy made or lost.
  • Initial Capital: The starting cash you configured for the simulation.
  • Final Value: What your portfolio would be worth at the end, including any remaining cash and open positions.
  • Final Cash: The cash remaining after all trades, excluding any unrealized gains from open positions.
  • Max Drawdown: The largest peak-to-trough decline during the simulation. This is crucial for understanding risk - how much could you have been down at the worst point?
  • Unrealized Gain: Profit or loss on any shares still held at the end of the simulation.
  • Buy Trades / Sell Trades: Total number of each order type executed. This tells you how active your strategy is.
  • Win Rate: Percentage of profitable trades.

Trade Visualization

The price chart updates to show your actual entry and exit points:

  • Green markers (B): Buy orders executed at that price and time
  • Red markers (S): Sell orders executed at that price and time

This visual representation helps you understand when your strategy is trading and whether the timing makes sense given the price action.

Trade History

Below the chart, a detailed trade log shows every transaction: the date, action (buy/sell), quantity, price, and running totals. Use this to audit your strategy's behavior and identify patterns or problems.

Iterating on Your Strategy

The real power of backtesting comes from iteration:

  1. Review the results and identify issues (too many trades? exits too early? poor win rate?)
  2. Modify your script in the Scripts tab (adjust profit targets, stop losses, entry conditions)
  3. Return to the Backtester and run again with the same data
  4. Compare results to see if changes improved performance
  5. Test against different market conditions (bullish, bearish, high volatility)

Backtesting Limitations

While backtesting is valuable, remember that past performance doesn't guarantee future results. The backtester assumes perfect execution at the simulated price, which may not reflect real-world slippage or liquidity constraints. Always paper trade before going live, even with a well-backtested strategy.

System Architecture

Technical details about how DipSkip operates under the hood.

Script Execution

Your DipScript runs continuously in a loop, executing line by line. Each iteration evaluates all conditions against current market data and your position state. The execution frequency depends on your subscription tier.

Rate Limiting

To prevent hitting broker API limits and ensure fair usage across all users, DipSkip implements intelligent rate limiting:

  • Token Bucket Algorithm: API calls are rate-limited using a token bucket with automatic refill
  • Request Throttling: If limits are approached, requests are automatically queued
  • Graceful Degradation: The system prioritizes trade execution over data fetching when under load

Caching

To improve performance and reduce API calls, frequently accessed data is cached with appropriate TTLs:

  • Account Data: Cached for 60 seconds
  • Position Data: Cached for 60 seconds
  • Stock Prices: Cached for 30 seconds
  • Market Status: Cached for 60 seconds

Cache is automatically invalidated after trades to ensure your script sees updated position data.

Error Handling

DipSkip implements comprehensive error handling to ensure reliability:

  • Automatic Retries: Failed API calls are automatically retried with exponential backoff
  • Connection Timeouts: HTTP connections timeout after 15 seconds, requests after 30 seconds
  • Database Resilience: Database operations use connection pooling with automatic reconnection
  • Error Logging: All errors are logged with full context for debugging

Price Fetch Resilience

DipSkip includes intelligent handling for temporary price data failures to prevent unnecessary script pauses:

  • Retry on Failure: Each price fetch attempt includes up to 10 automatic retries with 500ms delays
  • Skip Counting: If a price fetch still fails after retries, the script execution is skipped (not paused)
  • Threshold Protection: After 20 consecutive skipped executions due to price fetch failures, the script is automatically paused
  • Automatic Recovery: The skip counter resets to zero after any successful price fetch

This approach ensures your scripts remain running through temporary market data interruptions while still protecting against persistent connectivity issues. You'll see log messages like:

Skipping execution due to price fetch failure (3/20 skips)

If your script is paused due to reaching the skip threshold, simply resume it once market data connectivity is restored. The skip counter will be reset when the script is resumed.

Scalability

The system is designed to handle hundreds of concurrent users:

  • Thread Pool: Configurable thread pool for handling concurrent script executions
  • Connection Pooling: Database connections are pooled for efficient resource usage
  • Synchronous Order Handling: Each script runs in its own thread, allowing orders to be tracked synchronously without blocking other scripts

Dark Mode Support

DipSkip fully supports dark mode across all interfaces. Your preference is saved and applied automatically. Toggle dark mode in your user settings.

Common Questions & Edge Cases

Here are answers to frequently asked questions and explanations of how DipScript handles unusual situations.

What happens outside market hours?

Your scripts continue running even when the market is closed, but trading commands (OBTAIN and SELL) won't execute outside market hours. Specifically:

  • Your script still evaluates conditions and updates variables
  • Trade commands are skipped (the condition returns false)
  • Chart data and prices still update when available
  • Regular US stock market hours are 9:30 AM - 4:00 PM Eastern Time

What if I try to buy or sell zero shares?

DipSkip validates all order quantities before submitting them. If your script calculates a quantity of zero (for example, OBTAIN 0 @ $MARKET_PRICE), the order is blocked with error code E-BUY-005 (Invalid Buy Quantity) and the script continues to the next line.

What happens if I divide by zero?

If your script contains an expression that results in division by zero (like $PROFIT / 0), that specific line will fail to evaluate. The script logs an error and continues to the next line. To avoid this, you can add a check:

// Safe division - only divide if denominator isn't zero
IF $ALL > 0 AND $PROFIT > $AMOUNT_INVESTED_SINCE_LAST_TRADE / $ALL THEN ...

How long do custom variables last?

Variables you create with SET persist for the lifetime of your running script. They keep their values between execution cycles. However, if you stop and restart a script, the SET variables are recalculated from scratch on each execution (since SET statements run every cycle).

Built-in variables like $PROFIT, $LAST_BUY_PRICE, and trade counts are stored in the database and persist even if you pause and resume your script.

Can I run multiple scripts on the same stock?

Yes, you can run multiple scripts on the same ticker. Each script operates independently with its own variables and trade counts. However, they share your actual brokerage position, so be careful—one script selling shares will affect the position that other scripts see.

Multiple Scripts Warning

Running multiple scripts on the same ticker can cause unexpected behavior. For example, if Script A buys shares and Script B sells them before Script A's profit target is reached, your strategy may not work as intended. Consider using a single, comprehensive script instead of multiple competing ones.

What's the maximum quantity or price I can use?

DipSkip supports quantities up to 10,000,000 shares and prices with up to 4 decimal places. These limits are designed to prevent accidental errors while supporting all normal trading scenarios, including penny stocks.

Error Codes

When DipSkip encounters an issue during script execution, it generates a structured error with a unique error code, descriptive message, and correlation ID for debugging. Understanding these codes helps you quickly diagnose and resolve issues.

Error Format

All errors follow this format:

[E-XXX-NNN] Error message | Correlation: uuid
  • E-XXX-NNN: The error code (category + number)
  • Error message: Human-readable description of what went wrong
  • Correlation ID: Unique identifier to trace the error through logs

Validation Errors (VAL)

Script syntax and structure issues that prevent execution.

CodeNameDescriptionResolution
E-VAL-001 Invalid Script Syntax Script failed validation checks Review your script syntax and fix any highlighted errors
E-VAL-002 Multiple OR Clauses Script has more than one OR operator in a line Split complex conditions into multiple lines with one OR each
E-VAL-003 Invalid Command Format Command structure doesn't match expected pattern Check command syntax: OBTAIN/SELL quantity @ price
E-VAL-004 Missing @ Symbol Trade command missing @ price separator Add @ followed by price: OBTAIN 100 @ $MARKET_PRICE
E-VAL-005 Invalid @ Format Command has multiple @ symbols Use only one @ symbol per command
E-VAL-006 Invalid OR Expression Neither side of OR expression is valid Ensure both sides of the OR are valid conditions
E-VAL-007 Invalid Comparison Comparison operator used with invalid operands Check that both sides of the comparison are valid values
E-VAL-008 Invalid Operator Unknown or unsupported operator Use supported operators: =, >, <, >=, <=
E-VAL-009 Unknown Value Unrecognized value or variable Check spelling of variables and ensure they start with $
E-VAL-010 Invalid USD Amount USD value couldn't be parsed Use valid numeric format: $100 or $100.50

Price/Data Fetch Errors (PRC)

Market data retrieval issues.

CodeNameDescriptionResolution
E-PRC-001 Stock Price Unavailable Unable to get current market price Execution skipped automatically; script pauses after 20 consecutive failures. Check ticker symbol, market hours, and broker connection.
E-PRC-002 Stale Price Data (Buy) Price fetch failed during buy order Execution skipped automatically; script pauses after 20 consecutive failures. Check market data connectivity.
E-PRC-003 Stale Price Data (Sell) Price fetch failed during sell order Execution skipped automatically; script pauses after 20 consecutive failures. Check market data connectivity.
E-PRC-004 Account Data Unavailable Unable to retrieve account info Check broker connection and API status

Ticker Errors (TKR)

Invalid or unknown ticker symbol issues.

CodeNameDescriptionResolution
E-TKR-001 Invalid Ticker Symbol Ticker symbol not found or not tradeable Verify the symbol is correct. DipSkip validates symbols against Tradier's API to ensure they're tradeable.

Pattern Day Trader Errors (PDT)

Day trading restriction violations. These protect you from PDT rule violations.

CodeNameDescriptionResolution
E-PDT-001 PDT Account Under Minimum PDT flagged account is under $25k equity Add funds to reach $25k or wait 90 days for PDT flag to clear
E-PDT-002 Would Trigger PDT This trade would trigger PDT status Wait for existing day trades to expire (5 business day rolling window)
E-PDT-003 PDT Day Trade Limit All 3 day trades used on account under $25k Wait for day trades to clear or add funds to reach $25k

Pattern Day Trader Rule

The PDT rule restricts accounts under $25,000 to 3 day trades per 5 business days. A day trade is buying and selling the same stock on the same day. DipSkip automatically tracks your day trades and prevents violations that could freeze your account.

Buy Order Errors (BUY)

Issues preventing buy orders from executing.

CodeNameDescriptionResolution
E-BUY-001 Insufficient Buying Power Not enough funds for the order Reduce order size or add funds to your account
E-BUY-002 Cannot Afford Minimum Can't afford even 1 share after safety buffer Add funds or choose a lower-priced stock
E-BUY-003 Buy Order Pending Already have an open buy order Wait for pending order to fill or cancel it
E-BUY-004 Buy Order Rejected Broker rejected the buy order Check broker rejection reason in your brokerage account
E-BUY-005 Invalid Buy Quantity Calculated quantity is zero or negative Review your quantity calculation in the script

Sell Order Errors (SEL)

Issues preventing sell orders from executing.

CodeNameDescriptionResolution
E-SEL-001 No Shares Owned No position to sell Verify you own shares before attempting to sell
E-SEL-002 Anti-Shorting Protection Sell quantity exceeds owned shares Reduce sell quantity or use $ALL to sell entire position
E-SEL-003 Pending Sell Conflict Pending sells would exceed position Wait for pending orders to complete or cancel them
E-SEL-004 Position Changed Position changed mid-execution Restart the script to retry
E-SEL-005 Sell Order Rejected Broker rejected the sell order Check broker rejection reason in your brokerage account
E-SEL-006 Invalid Sell Quantity Calculated sell quantity is invalid Review your quantity calculation in the script

Variable Resolution Errors (VAR)

Issues with variable substitution in scripts.

CodeNameDescriptionResolution
E-VAR-001 Variable Not Found Referenced variable doesn't exist Check variable spelling and ensure it's defined
E-VAR-002 Circular Reference Variables reference each other in a loop Break the circular dependency between variables

System/Internal Errors (SYS)

Unexpected system failures. These require investigation.

CodeNameDescriptionResolution
E-SYS-001 Script Crashed Unhandled exception during execution Check logs using correlation ID; contact support if persistent
E-SYS-002 Trading Internal Error Trading system error Retry the operation; check broker status
E-SYS-003 Database Error Database operation failed Restart your script to retry
E-SYS-004 Broker API Error Broker API returned unexpected error Check broker status page; may be temporary outage
E-SYS-005 Timeout Error Operation took too long Retry the operation; may indicate network issues

User-Initiated States (USR)

Actions triggered by user commands in scripts.

CodeNameDescriptionResolution
E-USR-001 Script Stopped STOP command executed in script This is intentional - your script reached a STOP command

Using the Correlation ID

Every error includes a unique correlation ID (shown with a fingerprint icon on the dashboard). This ID traces through all related log events and is essential for debugging complex issues.

Reporting Issues

When contacting support about an error, always include the full error code and correlation ID. This allows us to quickly locate and analyze the exact sequence of events that led to the error.

Visual Builder

The Visual Builder is a beginner-friendly interface for creating trading strategies. Instead of writing DipScript code manually, you can drag and drop blocks to build your logic visually. The builder automatically generates the corresponding DipScript code.

Accessing the Builder

Navigate to the Builder tab from the main navigation. You'll see a visual canvas where you can construct your strategy using blocks.

Building Blocks

The visual builder provides several types of blocks:

  • Ticker Block: Set which stock your strategy trades
  • Condition Block: Create IF/THEN logic with dropdowns for variables and operators
  • Action Block: Add OBTAIN, SELL, SET, or STOP commands
  • Variable Block: Define custom variables with SET

How It Works

  1. Add blocks to the canvas by clicking the block type you want
  2. Configure each block using the dropdown menus and input fields
  3. Connect conditions to actions to create IF/THEN rules
  4. Preview the generated code in the code panel
  5. Save your flow when complete

Code Preview

As you build visually, the generated DipScript code updates in real-time. You can switch to the code editor at any time to fine-tune the generated script or add advanced logic that isn't available in the visual interface.

When to Use the Builder

  • When you're new to DipScript and want to learn the syntax
  • For simple strategies with straightforward logic
  • When you prefer a visual approach to programming
  • For quickly prototyping strategy ideas

Builder Limitations

The visual builder supports common patterns but not every DipScript feature. For advanced strategies using macro variables, complex math, or nested conditions, you may need to edit the code directly.

Script Linter

The linter is a real-time validation tool that checks your DipScript code for errors as you type. It catches syntax mistakes, undefined variables, and logical issues before you run your script.

What the Linter Checks

  • Syntax Errors: Missing keywords, malformed commands, invalid operators
  • Variable Issues: Undefined variables, typos in variable names
  • Command Structure: Incorrect OBTAIN/SELL/SET syntax
  • Ticker Validation: Missing TICKER declaration
  • Condition Logic: Malformed IF/THEN statements

Using the Linter

The linter runs automatically in the script editor. When it detects an issue:

  • The problematic line is highlighted
  • An error icon appears in the line number gutter
  • Hovering over the error shows a description of the problem
  • The error count is displayed at the bottom of the editor

Common Linter Warnings

Warning Meaning Fix
No TICKER defined Script doesn't specify which stock to trade Add TICKER SYMBOL at the top
Unknown variable Variable hasn't been defined with SET Define the variable or fix the typo
Invalid condition IF statement is missing THEN or has bad syntax Use format: IF condition THEN action
Invalid command Command not recognized Use OBTAIN, SELL, SET, or STOP

Fix Errors Before Running

Scripts with linter errors can still be saved, but they may fail during execution. Always resolve all linter warnings before running a script in live or paper trading.

Script Scheduling

When you run a script, you can configure how frequently it executes. The execution frequency determines how often your script checks conditions and potentially makes trades.

Setting Execution Frequency

When adding a script to the engine from the Repository, you'll see a frequency selector. Common options include:

  • Every 5 seconds: Very frequent checking, good for scalping
  • Every 15 seconds: Frequent updates while reducing API load
  • Every 30 seconds: Balanced frequency for most strategies
  • Every 1 minute: Less frequent, suitable for swing-style day trading
  • Every 5 minutes: Infrequent checking for longer-term positions

How Scheduling Works

The execution engine runs your script at the configured interval:

  1. Fetch the current market price for your ticker
  2. Update all built-in variables ($PROFIT, $MARKET_PRICE, etc.)
  3. Evaluate each line of your script from top to bottom
  4. Execute any commands where conditions are met
  5. Wait for the next scheduled execution

Choosing the Right Frequency

Strategy Type Recommended Frequency Reason
Scalping 5-15 seconds Need to catch small price movements quickly
Momentum 15-30 seconds Balance between responsiveness and stability
Swing (intraday) 1-5 minutes Larger moves, less noise from small fluctuations

API Rate Limits

Very frequent execution (every 5 seconds) uses more API calls. If you're running multiple scripts simultaneously, consider slightly longer intervals to stay within broker API limits.

Circuit Breakers

Circuit breakers are safety mechanisms that automatically pause your script when certain risk thresholds are exceeded. They protect you from runaway losses, malfunctioning strategies, and unusual market conditions.

Why Use Circuit Breakers

Even well-tested strategies can behave unexpectedly in live markets. Circuit breakers provide a safety net by automatically stopping execution when predefined limits are hit. This gives you time to review what happened before losses accumulate.

Types of Circuit Breakers

1. Max Loss Protection

Pauses your script when the current position loses more than a specified amount. You can configure this as a dollar amount or percentage.

  • Dollar-based: "Pause if I lose more than $500"
  • Percentage-based: "Pause if I lose more than 10%"

When triggered, the script pauses but your position remains open. You must manually decide whether to close the position or resume the script.

2. Consecutive Losses

Pauses your script after a series of losing trades in a row. This catches strategies that may be malfunctioning or trading against a strong trend.

  • Tracks sell trades that result in a loss
  • Triggers after N consecutive losing trades
  • Resets the count after any profitable trade

3. Rapid Trade Limiting

Pauses your script if it executes too many trades in a short period. This protects against scripts that might be rapidly cycling in and out of positions due to a logic error.

  • Monitors trades per minute
  • Triggers when trade frequency exceeds the limit
  • Prevents excessive commission costs and potential PDT issues

Configuring Circuit Breakers

Circuit breakers are configured when you add a script to the engine:

  1. Go to the Repository tab
  2. Click Run on the script you want to start
  3. In the dialog, expand the Circuit Breakers section
  4. Enable and configure each circuit breaker type
  5. Click Start Script

When Circuit Breakers Trigger

When any circuit breaker is triggered:

  • The script immediately pauses
  • You receive an email notification (if enabled)
  • The dashboard shows the paused status with the reason
  • Your existing position remains unchanged

Resetting Circuit Breakers

When you resume a paused script, all circuit breaker counters are reset to zero. This means:

  • The consecutive loss counter goes back to 0
  • The rapid trade counter resets
  • Max loss tracking starts fresh from your current position

This gives you a clean slate after reviewing what triggered the circuit breaker and deciding to continue running your strategy.

Recommended Settings

Start with conservative circuit breaker settings and adjust based on your strategy's normal behavior. A max loss of 5-10% and 3 consecutive losses is a reasonable starting point for most strategies.

Circuit Breakers Don't Sell

Circuit breakers pause your script but do not automatically sell your position. If you want automatic selling at a loss threshold, use a stop-loss condition in your script (e.g., IF $PROFIT < -500 THEN SELL $ALL). Circuit breakers are an additional safety layer on top of your script logic.

Email Notifications

DipSkip sends email notifications to keep you informed about important events. Notifications are sent to the email address associated with your account.

Types of Notifications

Script Error Notifications

Sent when a script encounters an error and pauses. The email includes:

  • Script name and ticker symbol
  • Error description
  • Correlation ID for debugging
  • Whether it's a paper or live trading script

Circuit Breaker Notifications

Sent when a circuit breaker triggers. The email includes:

  • Which circuit breaker was triggered
  • The threshold that was exceeded
  • Current position status
  • Script details

Alert Notifications

Sent when alerts you've configured are triggered (see Alerts). These include price alerts, profit/loss alerts, and trade alerts.

Notification Settings

You can configure notification preferences in the Settings tab. Options include enabling or disabling specific notification types.

Check Your Spam Folder

If you're not receiving notifications, check your spam or junk folder. Add the DipSkip sender address to your contacts to ensure delivery.

Repository

The Repository is where all your saved scripts (flows) are stored. Think of it as your strategy library—scripts you've created but aren't currently running.

Repository vs Engine

  • Repository: Storage for saved scripts (not running)
  • Engine: Scripts that are actively running and trading

You create and edit scripts in the Editor, save them to the Repository, and then add them to the Engine when you want them to start trading.

Managing Your Repository

The Repository tab shows all your saved flows with:

  • Script name and ticker symbol
  • Paper or live trading designation
  • Last modified date
  • Action buttons (Run, Edit, Duplicate, Delete)

Running a Script

To start a script from the Repository:

  1. Find the script in your Repository
  2. Click the Run button
  3. Configure execution frequency and circuit breakers
  4. Click Start Script

The script moves to the Engine and begins executing at your configured frequency.

Flow Actions

The Repository provides several actions for managing your scripts.

Duplicate Flow

Creates an exact copy of a script. Useful when you want to:

  • Test variations of a strategy without modifying the original
  • Create a paper trading version of a live script
  • Use an existing script as a template for a new one

The duplicate is saved with "(Copy)" appended to the name. You can rename it after duplication.

Transfer Flow

Moves a script between paper trading and live trading modes. When you transfer:

  • The script code remains identical
  • Variables are reset (profit history, trade counts, etc.)
  • The script must be re-added to the Engine to run

Transfer Carefully

Transferring from paper to live means real money is at stake. Always verify your script logic is working correctly in paper trading before transferring to live.

Delete Flow

Permanently removes a script from your Repository. This action cannot be undone. If the script is currently running in the Engine, you must stop it first.

Auto-Sell on Delete

When you delete or stop a running script, DipSkip can optionally sell any shares that script was managing. This is controlled by the Auto-sell script stock setting in your Settings.

  • Enabled: Automatically sells shares when script is stopped/deleted
  • Disabled: Leaves shares in your account (you must sell manually)

The auto-sell feature is PDT-aware—it won't sell if doing so would trigger a pattern day trader flag on your account.

Orders Tab

The Orders tab provides a comprehensive view of all trades executed by your scripts. Review your trade history, analyze performance, and manage pending orders.

Order History

The main orders table shows every executed trade with:

  • Date/Time: When the order was filled
  • Script: Which script placed the order
  • Symbol: Stock ticker
  • Side: Buy or Sell
  • Quantity: Number of shares
  • Price: Average fill price
  • Profit: For sell orders, the realized profit/loss

Filtering Orders

Use the filter controls to narrow down the order list:

  • Date Range: View orders from a specific period
  • Symbol: Filter to a specific stock
  • Side: Show only buys or only sells
  • Script: Filter to a specific script's orders

Order Statistics

The top of the Orders tab displays summary statistics:

  • Total number of trades
  • Total realized profit/loss
  • Win rate (percentage of profitable sells)
  • Average profit per trade

Manual Order Actions

Manual Sell

From the Dashboard, you can manually sell shares that a script is managing. Click the Sell button next to a running script to immediately liquidate the position at market price.

Cancel Pending Orders

If a limit order hasn't filled yet, you can cancel it. Pending orders appear in the Orders tab with a "Pending" status and a Cancel button.

Manual Actions and Scripts

If you manually sell shares while a script is running, the script will detect the new position size on its next execution. Be aware that the script may immediately buy back shares if your entry conditions are still met.

Performance Tab

The Performance tab provides detailed analytics about your trading results over time. Track profitability, identify patterns, and measure the effectiveness of your strategies.

Performance Overview

The main dashboard shows key metrics:

  • Total Profit/Loss: Cumulative realized P&L across all scripts
  • Today's P&L: Profit or loss from today's trades
  • Win Rate: Percentage of trades that were profitable
  • Total Trades: Number of completed round-trip trades

Performance by Symbol

See how each stock you've traded has performed:

  • Profit/loss per symbol
  • Number of trades per symbol
  • Win rate per symbol
  • Average profit per trade

This helps identify which stocks your strategies work best on.

Performance History

View your trading results over different time periods:

  • Daily breakdown
  • Weekly summary
  • Monthly totals

Cumulative Performance Chart

A chart showing your cumulative profit/loss over time. This visualizes:

  • Overall growth or decline
  • Consistency of returns
  • Drawdown periods
  • Recovery patterns

Use Performance Data to Improve

Regularly review your performance metrics. If certain symbols consistently underperform, consider removing them from your strategies. If specific time periods show losses, analyze what market conditions were present.

Settings Overview

The Settings tab contains all configuration options for your DipSkip account. Access it from the main navigation to customize trading behavior, notifications, and display preferences.

Settings Categories

  • Trading Settings: Control trading behavior and safety features
  • Notification Settings: Configure email alerts and notifications
  • Display Settings: Timezone and formatting preferences
  • Account Settings: Broker connection and profile information

Trading Settings

These settings control how DipSkip executes trades and manages positions.

Auto-Sell Script Stock

When enabled, DipSkip automatically sells any shares held by a script when you stop or delete that script.

  • Enabled: Shares are sold at market price when script stops
  • Disabled: Shares remain in your account; you must sell manually

This feature is PDT-aware and will not auto-sell if it would trigger a pattern day trader flag on your account.

PDT Protection

Controls pattern day trader protection behavior:

  • Warns before trades that would count as day trades
  • Tracks your day trade count against the 4-trade limit
  • Can prevent trades that would trigger PDT status

Margin Settings

If you have a margin account, these settings control margin usage:

  • Allow Margin: Enable or disable trading on margin
  • Max Margin Amount: Limit how much margin can be used
  • Margin Warning Threshold: Alert when approaching margin limits

Margin Risk

Trading on margin amplifies both gains and losses. If you enable margin, ensure you understand the risks and have appropriate stop-losses in your scripts.

Notification Settings

Configure which email notifications you want to receive.

Available Notification Types

Notification Description Default
Script Errors When a script pauses due to an error Enabled
Circuit Breaker Alerts When a circuit breaker triggers Enabled
Trade Alerts When configured trade alerts trigger Enabled
Price Alerts When symbol price alerts trigger Enabled

Timezone Setting

Set your preferred timezone for displaying timestamps throughout DipSkip:

  • Order timestamps
  • Log entries
  • Chart data
  • Alert triggers

All times are stored in UTC internally and converted to your selected timezone for display.

Market Hours

Regardless of your timezone setting, the US stock market operates on Eastern Time. Regular trading hours are 9:30 AM - 4:00 PM ET.

Disclaimer

The examples and strategies shown in this documentation are for educational purposes only and do not constitute financial advice. Trading stocks involves substantial risk of loss and is not suitable for every investor. Always conduct thorough testing, understand the risks, and consider your risk tolerance before implementing any automated trading strategy. Past performance does not guarantee future results.