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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    36 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    19 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X