The Landscape Charting & Multi-Column Matrix View (MultiLegMatrixOrderEntryWidget, #117) provides a professional-grade widescreen charting and execution environment for tablet, desktop, and mobile landscape orientations.
It combines full-width interactive technical charts with a collapsible, responsive split-screen multi-leg options matrix—allowing options traders to visually identify technical levels (support, resistance, moving averages, and VWAP) while simultaneously configuring and pricing complex multi-leg options orders in real time.
When analyzing charts on standard mobile portrait layouts, options traders frequently experience disjointed context switching:
The Landscape Chart Matrix eliminates this friction by leveraging the horizontal viewport:
+----------------------------------------------------------------------------------------------------+
| FullScreenInstrumentChartWidget (Landscape Mode) |
+----------------------------------------------------+-----------------------------------------------+
| Left Panel: Technical Chart | Right Panel: Multi-Leg Order Matrix |
| | |
| [Symbol: NVDA $128.50 (+3.2%)] | [Strategy: Bull Call Spread] [Presets v] |
| ------------------------------------------------ | ------------------------------------------- |
| Candlestick / Area Chart with Overlays | Leg 1: BUY CALL $125.00 Exp: Oct 18 $6.20 |
| - SMA 20 / SMA 50 / VWAP | Leg 2: SELL CALL $135.00 Exp: Oct 18 $2.10 |
| - Volume Histogram / Time Series Markers | ------------------------------------------- |
| | Net Debit: $4.10 ($410.00 / contract) |
| | Max Profit: $5.90 ($590.00) | Max Loss: $410 |
| | Risk/Reward: 1.44:1 | Breakeven: $129.10 |
| | [Qty: 1] [Limit: $4.10] [TIF: GTC] |
| | [====== REVIEW & SUBMIT SPREAD ======] |
+----------------------------------------------------+-----------------------------------------------+
lib/model/multi_leg_order_entry.dart)The multi-leg execution framework is driven by two primary models:
MultiLegOrderLeg: Represents an individual contract leg:
action: LegAction.buy or LegAction.selltype: LegType.call or LegType.putstrike: Contract strike priceexpirationDate: Target expiration dateratio: Contract quantity multiplier per strategy unit (default 1)premium: Mark price per sharesignedPremium: Computes net cash flow contribution (negative for buy/outflow, positive for sell/inflow)MultiLegOrderEntry: Strategy container managing aggregate pricing and risk metrics:
strategyType: StrategyType.vertical, straddle, strangle, iron_condor, custom, etc.netPremium: Sum of signed leg premiums ($\sum \text{signedPremium}$). Positive indicates Net Credit; negative indicates Net Debit.maxProfitPerContract & maxLossPerContract: Closed-form profit and loss limits based on spread width and debit/credit structure.breakevenPoints: Dynamic calculation of underlying prices at expiration where P&L is exactly $0.riskRewardRatio: Ratio of maximum potential profit to maximum potential loss.MultiLegMatrixOrderEntryWidget (lib/widgets/multi_leg_matrix_order_entry_widget.dart):
gtc / day).FullScreenInstrumentChartWidget & InstrumentChartWidget:
MediaQuery.of(context).orientation == Orientation.landscape or wide display width).During the development of the Landscape Chart Matrix, several core serialization and type safety hardening measures were implemented:
OptionChain.expirationDates serialization converts mapped iterables to a concrete List<String> of ISO 8601 strings, preventing lazy MappedListIterable serialization failures.Constants.toEncodable defensively converts arbitrary Dart Iterable instances into JSON-safe lists and formats DateTime objects.ForexHolding.fromJson and InstrumentPosition.fromJson robustly handle numeric values passed as either numbers or strings.Row layouts with responsive Wrap and flex constraints to eliminate RenderFlex overflow errors across various mobile device aspect ratios.Comprehensive unit and widget tests are located in test/landscape_chart_matrix_test.dart: