AlertaScript: अपने स्वयं के Indicators और Strategies लिखना
9 min read
AlertaScript AlertaChart की कस्टम indicator भाषा है। यह आपको अपने स्वयं के technical indicators, custom overlays, और पूर्ण backtestable strategies लिखने देती है — सभी उसी लाइव चार्ट के विरुद्ध render होते हैं जिसे आप हर दिन उपयोग करते हैं।
आप क्या बना सकते हैं
- Custom overlays: price pane पर खींची गई lines, channels, bands। - Custom sub-panes: oscillators, ratio plots, कुछ भी जो चार्ट के नीचे रहता है। - Indicator output से अलर्ट: जब आपके script की condition सत्य होती है तो एक AlertaChart अलर्ट trigger करें। - Backtests और strategy reports: एक strategy mode Strategy Tester पैनल के माध्यम से win rate, profit factor, drawdown, और equity-curve charts produce करता है।
आप (अभी तक) AlertaScript से वास्तविक orders place नहीं कर सकते। strategy mode विश्लेषण और reports के लिए है — लाइव trading roadmap पर है लेकिन आज shipping नहीं हो रहा।
एडिटर
टॉप nav से AlertaScript खोलें। editor तीन columns में विभाजित है: बाईं ओर file tree (आपके saved scripts), बीच में code, और दाईं ओर एक live preview chart। Save script को आपकी लाइब्रेरी (Pro) में स्टोर करता है, Run इसे visible चार्ट के विरुद्ध execute करता है और result render करता है, और Apply script को chart indicator के रूप में bind करता है ताकि यह symbol switches में आपके साथ travel करे।
भाषा क्या support करती है
- Built-in series: open, high, low, close, volume, time। - गणित: math.abs, math.max, math.min, math.round, math.log, और JavaScript के Math में सब कुछ जो alerta. prefix से accessible है। - Plotting: plot, plotshape, plotcandle, bgcolor, hline। - Conditionals + state: if/else, persistent state के लिए var, ta.crossover, ta.crossunder, ta.highest, ta.lowest, और अधिकांश TA library functions। - Strategies: strategy.entry, strategy.exit, strategy.close_all एक Strategy Tester panel के साथ जो metrics produce करता है।
alerta. namespace AlertaChart-specific built-ins जोड़ता है: alerta.session, alerta.market_type, alerta.is_futures, alerta.funding_rate (केवल futures), alerta.open_interest (केवल futures)।
Scripts शेयर करना
Share बटन एक URL generate करता है जो किसी अन्य user के editor में आपका script load करता है जब वे उस पर क्लिक करते हैं। Community templates के लिए उपयोगी। Share link के माध्यम से लोड किए गए Scripts तब तक read-only रहते हैं जब तक recipient उन्हें अपनी लाइब्रेरी में clone नहीं करता।