WhaleRider
A complete interface for defining, validating, historically simulating, and analyzing user-directed systematic research through AI, VS Code, or the command line.
What the system does
Users define their own systematic rules and research hypotheses. WhaleRider turns those instructions into durable, inspectable definitions, validates them, runs historical simulations using market and financial data, and helps analyze simulated results. Open generated YAML in VS Code for direct control, or continue the user-directed workflow through an AI or the CLI.
Get your admin access key
Enter your workspace name and admin email, complete payment, and verify the code sent to that email. The resulting key is your workspace’s primary admin credential and is shown once.
- Workspace details.Open Connect and provide your workspace name and admin email.
- Complete payment.WhaleRider Early Access is $50 per month per workspace.
- Verify your email.Enter the six-digit code sent to the admin email.
- Save the key.Copy or download the key when it is revealed, then add the WhaleRider MCP URL to your preferred AI.
Add one MCP URL to the AI you already use
In ChatGPT, Claude, Gemini, or Grok, create a custom MCP connector named WhaleRider and use https://mcp.whalerider.org as the server URL. When WhaleRider opens its authorization page, enter your admin access key to approve the connection.
Once authorized, ask naturally: create a trade plan, refine it, run a simulation, and explore results.
Install and connect the WhaleRider CLI
irm https://cli.whalerider.org | iex
curl -s https://cli.whalerider.org/install-wr.sh | tr -d ' ' | bash
Verify and create a profile
wr --version wr profile set --name default --access-key <YOUR_ACCESS_KEY> wr profile use --name default wr profile list
Profiles are required for platform operations such as listing deployed artifacts or starting simulations. Local compilation is deliberately independent and does not require an access profile.
Install the WhaleRider DSL plugin
- Open Extensions.Use the Extensions view inside VS Code.
- Search for WhaleRider DSL.The extension provides the language tooling used by generated YAML documents.
- Select Install.Open a WhaleRider YAML file to receive completion, hover documentation, diagnostics, and schema-aware validation while editing.
Four composable artifacts
Market scope, long or short side, indicators, signals, stateful entry and exit criteria, holding rules, ATR controls, and replacement behavior.
Reusable per-position value limits, minimum viable position size, and maximum position-risk budget.
One deployed trade plan bound to one deployed risk policy by immutable artifact identifiers.
One or more deployed strategies, capital, period, allocation limits, and optional margin and financing assumptions.
Compilation validates each YAML document and creates a fixed .wr artifact. Deployment returns the identifiers used by the next composition layer.
Describe the complete decision process
LONG or SHORT, with direction-aware ATR exits.Trade-plan risk controls
| Field | Purpose |
|---|---|
HOLDING_MAX_PERIOD | Maximum holding duration using days, hours, or minutes. |
REPLACEMENT_MODE | NONE, BEST, or WORST when a new entry has insufficient capital. |
ATR.LOOKBACK / INTERVAL | Volatility model used for simulated fill boundaries. |
ATR.STOP_LOSS | Required ATR multiple when ATR controls are enabled. |
ATR.TAKE_PROFIT | Optional take-profit distance in ATR multiples. |
ATR.MAX_SLIPPAGE | Maximum adverse movement permitted at entry. |
Define exactly what may be evaluated
| Selector | Supported values and behavior |
|---|---|
EXCHANGES | NYSE, NASDAQ, AMEX |
SECURITY_TYPES | STOCK, ETF |
IS_FUND | Include only funds or only non-funds. |
MARKET_INDICES | SP500, NASDAQ100, DOW30. Optional individually, but this or TICKERS is required. Historical membership is evaluated at the relevant event time. |
SECTORS | Basic materials, communication services, consumer cyclical, consumer defensive, energy, financial services, healthcare, industrials, real estate, technology, utilities. |
TICKERS | Explicit symbol restriction. Required when MARKET_INDICES is omitted. |
EXCLUDE_TICKERS | Final exclusion list; exclusions always win. |
A trade plan must supply MARKET_INDICES or TICKERS to bound its universe. Values inside one selector are alternatives, while supplied selectors are combined as restrictions. An ETF plan can use TICKERS: [CPER]; a ticker supplied alongside an index must also belong to that index at the evaluated time.
Supported source domains
Indicators can read market, company, event, macro, and position-history data. The table is the user-facing map of what may be measured and what may be filtered.
| Domain | Measurements | Filters and scope |
|---|---|---|
CANDLEOHLCV market bars | Open, Low, High, Close, Volume | Raw candle fields; interval required; optional explicit ticker |
INDEXIndex price bars | Open, Low, High, Close | Raw index fields; interval required; no volume |
DERIVEDArithmetic over named indicators | Any numeric expression over prior indicators | No raw-record filter; supports cross-sectional aggregation |
INCOMEIncome statement facts | Revenue, GrossProfit, Ebitda, OperatingIncome, NetIncome, Eps, EpsDiluted and all statement fields | Any schema field; exact case-sensitive names |
BALANCE_SHEETBalance sheet facts | Cash, receivables, inventory, assets, debt, liabilities, equity and all statement fields | Any schema field; exact case-sensitive names |
CASH_FLOWCash-flow statement facts | OperatingCashFlow, CapitalExpenditure, FreeCashFlow, financing and investing fields | Any schema field; exact case-sensitive names |
RATIOProfitability, valuation, leverage and coverage ratios | Margins, turnover, liquidity, valuation, leverage, coverage, yield and per-share metrics | Any ratio-record field; exact case-sensitive names |
MARKET_CAPMarket capitalization | MarketCap | Raw record fields; interval required; optional explicit ticker |
DIVIDENDDividend events | AdjDividend, Dividend | Any dividend-record field; optional explicit ticker |
SPLITStock split events | Numerator, Denominator | Any split-record field; optional explicit ticker |
DELISTDelisting events | Numeric fields exposed by the schema | Any delisting-record field; optional explicit ticker |
SECTOR_PESector valuation | PE | Select sector with Sector == Sector.VALUE; global domain |
INSIDERSInsider transactions and ownership | SecuritiesTransacted, Price, SecuritiesOwned | Side, TransactionType, TransactionOwner and other schema fields |
CONSOLIDATED_SHORTReported short interest | PreviousShortPositionQuantity, CurrentShortPositionQuantity, ChangePercent, AverageDailyVolumeQuantity, DaysToCoverQuantity | Any consolidated-short record field |
DAILY_SHORTDaily short volume | TotalParQuantity, ShortParQuantity, ShortExemptParQuantity | Any daily-short record field; interval required |
CONGRESSCongressional transactions | AmountRangeMin, AmountRangeMax | CongressChamber, TransactionSide and other schema fields |
ECONOMYMacroeconomic time series | Value | Select series with EconomicIndicator == EconomicIndicator.VALUE; global domain |
CALENDAR_REPORTCompany reporting calendar | EpsActual, EpsEstimated, RevenueActual, RevenueEstimated | Any calendar-report record field; optional explicit ticker |
POSITIONCompleted position history | EnterPrice, LastPrice, TakeProfitPrice, StopLossPrice, Size | Exited positions for the same account, strategy and ticker; excludes the open position |
Complete financial measurement families
Financial domains contain many available fields, so they are grouped below by statement family. Expand a family to see every supported measurement name.
MEASUREMENT: SecuritiesTransacted * Price FILTER: Side == Side.ACQUISITION
MEASUREMENT: Value FILTER: EconomicIndicator == EconomicIndicator.FEDERAL_FUNDS
- Enum constants use the qualified form
FieldName == EnumType.ENUM_MEMBER. - Filters may combine conditions with
AND,OR, and parentheses. DERIVEDindicators reference prior indicator names and do not accept raw-record filters.- Restrictive filters can yield missing periods; signals explicitly choose
IGNORE,TRUE, orFALSE. ECONOMYusesValueand selects the series throughEconomicIndicator.SECTOR_PEusesPEand selects the category throughSector.
Measurement and filter syntax
Income statement
RevenueCostOfRevenueGrossProfitResearchAndDevelopmentExpensesGeneralAndAdministrativeExpensesSellingAndMarketingExpensesSellingGeneralAndAdministrativeExpensesOtherExpensesOperatingExpensesCostAndExpensesNetInterestIncomeInterestIncomeInterestExpenseDepreciationAndAmortizationEbitdaEbitNonOperatingIncomeExcludingInterestOperatingIncomeTotalOtherIncomeExpensesNetIncomeBeforeTaxIncomeTaxExpenseNetIncomeFromContinuingOperationsNetIncomeFromDiscontinuedOperationsOtherAdjustmentsToNetIncomeNetIncomeNetIncomeDeductionsBottomLineNetIncomeEpsEpsDilutedWeightedAverageShsOutWeightedAverageShsOutDilBalance sheet
CashAndCashEquivalentsShortTermInvestmentsCashAndShortTermInvestmentsNetReceivablesAccountsReceivablesOtherReceivablesInventoryPrepaidsOtherCurrentAssetsTotalCurrentAssetsPropertyPlantEquipmentNetGoodwillIntangibleAssetsGoodwillAndIntangibleAssetsLongTermInvestmentsTaxAssetsOtherNonCurrentAssetsTotalNonCurrentAssetsOtherAssetsTotalAssetsTotalPayablesAccountPayablesOtherPayablesAccruedExpensesShortTermDebtCapitalLeaseObligationsCurrentTaxPayablesDeferredRevenueOtherCurrentLiabilitiesTotalCurrentLiabilitiesLongTermDebtCapitalLeaseObligationsNonCurrentDeferredRevenueNonCurrentDeferredTaxLiabilitiesNonCurrentOtherNonCurrentLiabilitiesTotalNonCurrentLiabilitiesOtherLiabilitiesCapitalLeaseObligationsTotalLiabilitiesTreasuryStockPreferredStockCommonStockRetainedEarningsAdditionalPaidInCapitalAccumulatedOtherComprehensiveIncomeLossOtherTotalStockholdersEquityTotalStockholdersEquityTotalEquityMinorityInterestTotalLiabilitiesAndTotalEquityTotalInvestmentsTotalDebtNetDebtCash flow
NetIncomeDepreciationAndAmortizationDeferredIncomeTaxStockBasedCompensationChangeInWorkingCapitalAccountsReceivablesInventoryAccountsPayablesOtherWorkingCapitalOtherNonCashItemsNetCashProvidedByOperatingActivitiesInvestmentsInPropertyPlantAndEquipmentAcquisitionsNetPurchasesOfInvestmentsSalesMaturitiesOfInvestmentsOtherInvestingActivitiesNetCashProvidedByInvestingActivitiesNetDebtIssuanceLongTermNetDebtIssuanceShortTermNetDebtIssuanceNetStockIssuanceNetCommonStockIssuanceCommonStockIssuanceCommonStockRepurchasedNetPreferredStockIssuanceNetDividendsPaidCommonDividendsPaidPreferredDividendsPaidOtherFinancingActivitiesNetCashProvidedByFinancingActivitiesEffectOfForexChangesOnCashNetChangeInCashCashAtEndOfPeriodCashAtBeginningOfPeriodOperatingCashFlowCapitalExpenditureFreeCashFlowIncomeTaxesPaidInterestPaidRatios
GrossProfitMarginEbitMarginEbitdaMarginOperatingProfitMarginPretaxProfitMarginContinuousOperationsProfitMarginNetProfitMarginBottomLineProfitMarginReceivablesTurnoverPayablesTurnoverInventoryTurnoverFixedAssetTurnoverAssetTurnoverCurrentRatioQuickRatioCashRatioSolvencyRatioPriceToEarningsRatioPriceToEarningsGrowthRatioForwardPriceToEarningsGrowthRatioPriceToBookRatioPriceToSalesRatioPriceToFreeCashFlowRatioPriceToOperatingCashFlowRatioDebtToAssetsRatioDebtToEquityRatioDebtToCapitalRatioLongTermDebtToCapitalRatioFinancialLeverageRatioWorkingCapitalTurnoverRatioOperatingCashFlowRatioOperatingCashFlowSalesRatioFreeCashFlowOperatingCashFlowRatioDebtServiceCoverageRatioInterestCoverageRatioShortTermOperatingCashFlowCoverageRatioOperatingCashFlowCoverageRatioCapitalExpenditureCoverageRatioDividendPaidAndCapexCoverageRatioDividendPayoutRatioDividendYieldDividendYieldPercentageRevenuePerShareNetIncomePerShareInterestDebtPerShareCashPerShareBookValuePerShareTangibleBookValuePerShareShareholdersEquityPerShareOperatingCashFlowPerShareCapexPerShareFreeCashFlowPerShareNetIncomePerEBTEbtPerEbitPriceToFairValueDebtToMarketCapEffectiveTaxRateEnterpriseValueMultipleIndicators, transformations, signals, and state
Indicator fields
Each indicator has a unique name and domain. Depending on the source, it may include a measurement, interval, explicit ticker, raw-record filter, ordered steps, cross-sectional aggregation, relative time window, and evaluation interval.
Transformation library
RAWSMAEMAWMADEMATEMAVWMAVWAPRSIWILLIAMS_RADXATRATRPOBVADLMFISTD_DEVCMFFORCE_INDEXMACDKAMAPIVOTROLLING_PIVOTFIBONACCIBOS_CHOCHORDER_BLOCKSWINGCHANGECHANNELLINEPATTERNRANKPERCENTILESARSLOPECLAMPFLOORVOLUME_PROFILEAGGREGATIONTHRESHOLDBUCKETABSSteps run in order, with each output becoming the next input. The language includes moving averages, oscillators, volatility, volume, pivots, channels, patterns, market structure, trend lines, ranking, bucketing, thresholds, and aggregation.
Signals
Signals are named Boolean expressions over indicators. They support arithmetic, comparisons, AND/OR, interval streaks, minimum and maximum streak bounds, and deliberate missing-data behavior.
Stateful criteria
Entry and exit logic can be a tree rather than a single condition. NEXT expresses sequence, sibling nodes express alternative branches, ABORT invalidates a route, FOR requires elapsed calendar time, TIMEOUT expires a route, and FREEZE_INDICATORS preserves setup or entry-time values for later decisions.
FOR only for elapsed calendar time.Control position size and aggregate exposure
| Risk-policy field | Meaning |
|---|---|
MAX_POSITION_VALUE_PCT | Maximum market value of one position as a percentage of current equity. |
MIN_POSITION_VALUE_PCT | Reject a calculated position below this percentage of current equity. |
MAX_POSITION_RISK_PCT | Target maximum loss budget for one position as a percentage of current equity. |
With an ATR stop, the position-risk budget is divided by the entry-to-stop loss per share, including estimated commission. Without an ATR stop, WhaleRider sizes from capital limits and derives a stop price from the risk budget. Gaps, slippage, evaluation frequency, and simulated fill delay mean this is a sizing and control model, not a guaranteed-loss limit.
The simulation’s MAX_EQUITY_ALLOCATION is a separate gross-exposure cap for the strategy. All strategies share account equity and buying power. Allocations may exceed 100 to permit leveraged exposure or overlapping capacity, but they never create additional buying power.
Run one or more strategies in a shared account
| Margin field | Interpretation |
|---|---|
INITIAL_MARGIN_RATE | Fraction of position value required as initial equity. |
MAINTENANCE_MARGIN_RATE | Fraction of open-position value required as maintenance equity. |
MARGIN_INTEREST_RATE | Annual financing rate on a margin debit balance. |
SHORT_BORROW_RATE | Annual borrow rate applied to short positions. |
Complete command surface
This reference is generated from the installed CLI using wr -h --all. Angle-bracket values are required placeholders unless shown in brackets.
| Area | Command | Purpose |
|---|---|---|
| Core | wr version | Show product, version, runtime, OS and architecture. |
| Core | wr help | List command names and descriptions. |
| Core | wr compile --file <yaml> | Validate a document and produce a portable .wr artifact. |
| Core | wr deploy --file <artifact.wr> | Deploy a compiled artifact. |
| Core | wr undeploy --document-kind <kind> --deployment-id <id> | Remove a deployment. |
| Profiles | wr profile set --name <name> --access-key <key> | Create or update a local authentication profile. |
| Profiles | wr profile use --name <name> | Select the active profile. |
| Profiles | wr profile list | List profiles and active state. |
| Profiles | wr profile remove --name <name> | Remove a profile and unset it when active. |
| Identity | wr organization get | Get the current organization. |
| Identity | wr self get | Get the current principal. |
| Identity | wr self access-key create | Create an access key for the current principal. |
| Identity | wr access-key get --access-key-id <id> | Get access-key metadata. |
| Identity | wr access-key list | List access keys. |
| Identity | wr access-key state set --access-key-id <id> --is-active <bool> | Activate or deactivate an access key. |
| Identity | wr admin create|get|list | Manage administrator principals. |
| Identity | wr app create|get|list | Manage application principals. |
| Identity | wr app access-key create --principal-id <id> | Create an application access key. |
| Identity | wr principal state set --principal-id <id> --is-active <bool> | Activate or deactivate a principal. |
| Artifacts | wr trade-plan get --trade-plan-id <id> | Retrieve a deployed trade plan. |
| Artifacts | wr trade-plan list | List deployed trade plans. |
| Artifacts | wr risk-policy get --risk-policy-id <id> | Retrieve a deployed risk policy. |
| Artifacts | wr risk-policy list | List deployed risk policies. |
| Artifacts | wr strategy get --strategy-id <id> | Retrieve a deployed strategy. |
| Artifacts | wr strategy list | List deployed strategies. |
| Artifacts | wr simulation get --simulation-id <id> | Retrieve a simulation definition. |
| Artifacts | wr simulation list | List simulation definitions and run state. |
| Simulation | wr simulation run --simulation-id <id> | Start a historical simulation. |
| Simulation | wr simulation run get --simulation-run-id <id> | Get run status and timestamps. |
| Simulation | wr simulation run list | List simulation runs. |
| Simulation | wr simulation run delete --simulation-run-id <id> | Delete a simulation run. |
| Simulation | wr simulation run performance get --simulation-run-id <id> --group-interval <DAILY|WEEKLY|MONTHLY|YEARLY|FULL> | Return grouped performance and risk statistics. |
Performance output
The performance command can group results daily, weekly, monthly, yearly, or across the full run. It returns trade counts, winners and losers, realized profit and return, extrema and averages, duration, position value, profit and loss, batting average, win/loss ratio, exposure, maximum drawdown, Sharpe, Sortino, profit factor, and average P&L per trade.
Continue from a completed run into research
A completed simulation is not the end of the workflow. Use the AI or CLI to retrieve authoritative summary metrics, group performance by time, inspect trades with pagination, isolate a difficult month, identify best and worst trades, and build annual-return charts, monthly heatmaps, or weekly equity curves.