Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculate moving avg on time values different than session times

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Calculate moving avg on time values different than session times

    Is it possible to edit the SMA for example to calculate off a time separate than the session times? So if I wanted to look at a 24 hour chart but wanted to see the 14 period SMA plotted based on the 8:00 to 3:00 session. Is this possible?

    #2
    You could add a custom time filter to your SMA indicator -

    Code:
     
    protected override void OnBarUpdate()
    {
    if (ToTime(Time[0]) >= 80000 && ToTime(Time[0]) <= 150000)
    Plot0.Set(SMA(Close, 20)[0]);
    
    
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    152 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    305 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    244 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    345 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    176 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X