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 sjsj2732, 03-23-2026, 04:31 AM
    0 responses
    154 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    356 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    393 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    182 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    138 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X