Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Display 2 days on one chart

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

    Display 2 days on one chart

    Hello
    I wish to display current EMA and yesterday EMA for the same time period.

    EMA(int period)[int barsAgo]
    EMA(ISeries<double> input, int period)[int barsAgo]

    If I have a 5 minute bar, I have 288 in a day. barsAgo =288 except it doesn't work on Monday.

    The magic is to calculate barsAgo for for same time previous trading day. Holidays make it dicy too.

    Ideas, suggestions?

    Thanks



    Morris

    #2
    Hello morrnel,

    That would require some logic to do, as you mentioned there would be some items to account for like holidays. You could use the GetBar method which takes a time. The time could be Time[0] minus a day.



    A barsago value is returned if the bar is found. This would be where some logic would be needed to make sure a positive bars ago was found.

    You would could then use the BarsAgo with the EMA.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    637 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    571 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X