DSL Script Editor
(Engine loading...)
Reset
Clear All
Quick Examples:
Custom Indicators Full Example
Simple Main Line
Simple Sub Line
Clear All Custom Indicators
📊 Data Access Test
📈 Technical Indicators Test
🕯️ Candlestick Pattern Detection
🏷️ Conditional Markers Example
📝 Script Editor
// Example Script - Custom Main & Sub Indicators // ============================================ // 1. Custom main indicator: OHLC mean channel // ============================================ plotMain({ id: 'ohlc_mean', calculator: (idx, open, high, low, close, volume) => { return (high + low + close) / 3; }, options: { name: 'OHLC Mean', color: '#FF6B6B', width: 2, style: 'solid' } }); // 2. Another main indicator: Price volatility (High - Low) plotMain({ id: 'volatility', calculator: (idx, open, high, low, close, volume) => { return high - low; }, options: { name: 'Volatility', color: '#4ECDC4', width: 1, style: 'dashed' } }); // 3. Batch add main indicators - multiple lines plotMain([ { id: 'upper_band', calculator: (idx, open, high, low, close, volume) => { return close * 1.05; }, options: { name: 'Upper Band', color: '#45B7D1', width: 1, style: 'dotted' } }, { id: 'lower_band', calculator: (idx, open, high, low, close, volume) => { return close * 0.95; }, options: { name: 'Lower Band', color: '#F39C12', width: 1, style: 'dotted' } } ]); // 4. Custom sub indicator: RSI style plotSub({ id: 'custom_rsi', calculator: (idx, open, high, low, close, volume) => { return 50 + Math.sin(idx * 0.1) * 30; }, options: { name: 'Custom RSI', color: '#FF6B6B', width: 2, type: 'line' } }); // 5. Custom sub indicator: Volume histogram plotSub({ id: 'custom_volume', calculator: (idx, open, high, low, close, volume) => { return volume / 1000; }, options: { name: 'Volume/1000', color: '#4ECDC4', type: 'histogram' } }); // 6. Batch add sub indicators plotSub([ { id: 'momentum', calculator: (idx, open, high, low, close, volume) => { return close - open; }, options: { name: 'Momentum', color: '#FF9800', type: 'line', width: 1 } }, { id: 'range_percent', calculator: (idx, open, high, low, close, volume) => { return ((high - low) / close) * 100; }, options: { name: 'Range%', color: '#9C27B0', type: 'area' } } ]); console.log("All custom indicators added"); console.log("Main indicators: OHLC Mean, Volatility, Upper/Lower Bands"); console.log("Sub indicators: Custom RSI, Volume, Momentum, Range %"); return { message: "Custom indicators test completed", mainCount: 5, subCount: 5 };
📋 Output Logs
Clear
Waiting for script execution...
Execute
Start
Stop