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 cmoran13, 04-16-2026, 01:02 PM
    0 responses
    70 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    41 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    166 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    101 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    165 views
    2 likes
    Last Post CaptainJack  
    Working...
    X