Tutorial: Sketch a Trading Strategy
Time series, indicators and strategy nodes
You will build: a trading strategy sketch with indicators. Time: about 10 minutes. Prerequisites: Beep.Skia and Beep.Ski.Quantitative.
1. Data and indicators
using Beep.Skia;
using Beep.Skia.Quantitative;
var manager = new DrawingManager();
var prices = new TimeSeriesNode { X = 60, Y = 120, Width = 180, Height = 80, Label = "AAPL 1d" };
var rsi = new IndicatorNode { X = 300, Y = 60, Width = 180, Height = 80, Label = "RSI(14)" };
var sma = new IndicatorNode { X = 300, Y = 200, Width = 180, Height = 80, Label = "SMA(50)" };
foreach (var node in new SkiaComponent[] { prices, rsi, sma })
manager.AddComponent(node);
manager.ConnectComponents(prices, rsi);
manager.ConnectComponents(prices, sma);
2. Strategy
var strategy = new StrategyNodes { X = 560, Y = 120, Width = 200, Height = 100, Label = "Mean reversion" };
manager.AddComponent(strategy);
manager.ConnectComponents(rsi, strategy);
manager.ConnectComponents(sma, strategy);
foreach (var line in manager.GetLines())
line.RoutingMode = LineRoutingMode.Orthogonal;
3. Charts
The family also provides chart components (bar, line, pie, scatter, area) that read their series from the node properties.
manager.RequestRedraw();
// The sample adds a chart with Tools > "Add Sample Chart (Quantitative)".
Next steps
- Quantitative family — chart and indicator components
- Theming — restyle the charts with theme tokens