OPEN-SOURCE SCRIPT
Step SMA

Step SMA – Block-Based Moving Average
Description:
Step SMA is a simple, block-based moving average that shows price trends in discrete steps. Instead of a continuous moving average, it divides the chart into fixed-length blocks and calculates an SMA within each block. At the start of each new block, the average resets, creating a clear “step” effect.
How it Works:
• Block Length: Set the number of bars per block (Block SMA Length).
• Step SMA Calculation: Computes the average of closes within each block. At the end of a block, the calculation resets for the next one.
• Restart Circles: Optional circles mark the first bar of each block for easy visual reference.
• Visual Defaults: The SMA line defaults to bright cyan (width 3) and restart circles default to orange (max size). All colors, line width, and circle size can be customized in the Style tab.
Key Features:
• Stepwise SMA for clear, block-level trend visualization
• Optional restart circles to highlight block starts
• Fully customizable styling via the Style tab
• Simple block length input to adjust sensitivity
Use Cases:
• Easily see short-term trends within discrete blocks
• Identify points where trend averages reset
• Compare block-level trends to standard SMA or EMA
Description:
Step SMA is a simple, block-based moving average that shows price trends in discrete steps. Instead of a continuous moving average, it divides the chart into fixed-length blocks and calculates an SMA within each block. At the start of each new block, the average resets, creating a clear “step” effect.
How it Works:
• Block Length: Set the number of bars per block (Block SMA Length).
• Step SMA Calculation: Computes the average of closes within each block. At the end of a block, the calculation resets for the next one.
• Restart Circles: Optional circles mark the first bar of each block for easy visual reference.
• Visual Defaults: The SMA line defaults to bright cyan (width 3) and restart circles default to orange (max size). All colors, line width, and circle size can be customized in the Style tab.
Key Features:
• Stepwise SMA for clear, block-level trend visualization
• Optional restart circles to highlight block starts
• Fully customizable styling via the Style tab
• Simple block length input to adjust sensitivity
Use Cases:
• Easily see short-term trends within discrete blocks
• Identify points where trend averages reset
• Compare block-level trends to standard SMA or EMA
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.