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. קרא עוד ב־תנאי השימוש.