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 อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน