Spectra

البرمجة

لغة برمجة فعلية، لا مجرد قائمة مؤشرات.

خمسة أنواع من السكربت، وصول إلى صفقات tick، معاينة وإعادة تشغيل محليتان، وتشغيل خادمي معزول 24/7 للتنبيهات الموجّهة — بلغة واحدة.

01 · خمسة أنواع، لغة واحدة.

خمسة أنواع، لغة واحدة.

Indicator وAlert وScreener وDrawing وStrategy. بناء الجملة موحّد؛ كل نوع يستهدف سطحاً معيّناً.

  • Indicator — يضيف سلسلة أو مؤشر تذبذب على الرسم. يعيش في معاينة الرسم بدون عبء.
  • Alert — تعبير منطقي يُقيَّم عند إغلاق كل شمعة. Push أو بريد أو Webhook — اختيارك.
  • Screener — يُرجع الرموز المطابقة لشرط. يعمل على قائمة مراقبة بجدول.
  • Drawing — أشكال برمجية على الرسم — مناطق العرض/الطلب وFVG وOB ومستويات مخصصة.
  • Strategy — كود يطلق أوامر. يُختبر باك تيست على نفس محرك التنفيذ الحقيقي.
golden-cross.spec
// @spectra-script 2
let fast = ta.sma(close, 20)
let slow = ta.sma(close, 50)

plot.line("Fast", fast, color = color.teal)
plot.line("Slow", slow, color = color.orange)
output close > fast and fast > slow

٤ أسطر. ترسم SMA سريع/بطيء وتُخرج إشارة منطقية.

02 · نفس اللغة، ثلاث بيئات.

نفس اللغة، ثلاث بيئات.

اكتب مرة. شغّل أينما طُبع سعر.

  • معاينة الرسم — تكتب فيتم رسم الخط فوراً. يُعاد تجميع البايت كود مع كل ضربة مفتاح في أقل من ٨٠ ميلي ثانية.
  • الباك تيستر — نفس السكريبت، يُعاد تشغيله شمعة بشمعة بانزلاق واقعي بنقاط أساس وعمولة لكل تنفيذ وتنفيذات جزئية ومعالجة فجوات.
  • عامل VPS — ضع وسم runs_on: vps فينطلق على عامل سحابي ٢٤/٧ — التنبيهات وأوامر الويب هوك مشمولة.
شريط سحب يقارن مخطط شموع عادياً بنفس المخطط بعد رسم مؤشر تباعد RSI كتبه المستخدمقبلبعد
شريط: مخطط عادي ← اسحب → مؤشر مخصص لتباعد RSI
25 ثانية · اكتب، احفظ، شاهد الرسم

03 · Tick scripting

React to the market one execution at a time.

Spectra Script v2 exposes the retained trade tape and a true per-print callback. Use it to inspect aggressor flow, dollar size, delta, print counts, and the largest execution without reducing the tape to candle closes.

  • feed.tap(feed.trades) returns a bounded, newest-first execution window.
  • on_trade(price, size, is_buy, ts) runs once for every valid print in timestamp order.
  • Live tape retains 60 seconds and up to 10,000 prints; archive replay covers up to 24 hours and 10,000 prints.
  • Unknown aggressor sides remain visible and are excluded from directional aggregates instead of being guessed.
whale-flow.spec
// @spectra-script 2let minimum_usd = param.float("Minimum USD", 5000000.0, min = 1.0)fn on_trade(price, size, is_buy, ts) {  alert.wire(    "whale_buy",    is_buy and price * size >= minimum_usd,    message = "Large aggressive buy"  )}output false

True trade callbacks · bounded state · deterministic replay

04 · Server runtime

Keep approved alerts running after you close the app.

Save an alert with a target symbol and timeframe, then route it to the server worker. Bar scripts execute on completed intervals; tick handlers receive the real aggressor stream in bounded 50 ms scheduler batches.

  • Independent per-script state with tenant isolation and persisted fire timestamps.
  • Hard CPU, memory, loop, and recursion budgets plus cancellation on overrun.
  • Cooldown enforcement, runtime error capture, metrics, alert events, and outbound delivery.
  • Strategies remain preview/backtest workflows; unattended server execution is deliberately limited to alert scripts.
server-breakout.spec
// Runs on the saved symbol + timeframelet baseline = ta.sma(close, 200)let active = close > baseline and volume > ta.sma(volume, 20) * 1.5alert.wire(  "volume_breakout",  active,  message = "Volume breakout confirmed")output active

Route: VPS or Both · symbol + timeframe required

05 · ضمانات العزل.

ضمانات العزل.

تنبيهك لن يوقف رسومك. كل سكريبت يعمل ضمن ميزانيات صارمة للمعالج والذاكرة، مفروضة على مستوى VM.

  • VM bytecode، لا sandbox JS. لا وصول إلى البيئة المضيفة.
  • ميزانية وقت معالج لكل سكريبت (افتراضي ٥٠ ميلي ثانية) وسقف ذاكرة (افتراضي ١٦ ميجا).
  • أعلام إلغاء — يمكن إنهاء سكريبت طويل المدى أثناء الشمعة.
  • لا مسارات `unsafe`. لا وصول لملفات أو شبكة إلا عبر دوال مدمجة موثوقة.
20 ثانية · شدّد الفلتر، شاهد القائمة تنكمش

اكتب مرة. تداول في كل مكان.

كامل لغة الإستراتيجيات وعامل السحابة ٢٤/٧ — مشمولة مجاناً لكل متداول أثناء الإطلاق.