Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reset Internal Bars on New Day

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

    Reset Internal Bars on New Day

    Hi,

    I am trying to setup a Strategy that operates each day with no historical data from prior days. I do back-tests and it is clear it is using the previous days bars to calculate the VMA. For example, I am using the following:
    VMA(period, volatilityPeriod)

    I would like it to reset the bars as if it was the 1st day each day. I don't exactly know how to do that easily. I have considered something more along the lines of this to implement the concept:
    VMA(Math.Min(period,Bars.BarsSinceSession), Math.Min(volatilityPeriod,Bars.BarsSinceSession))

    This would be a lot of work to change through-out the code and I don't think the VMA Indicator overlayed on the graph will reflect this re-calculation. Is there an easy way to do this for a strategy, is this only a side-affect of backtesting?

    Thanks

    #2
    NJA_MC, this would unfortunately not be possible without custom coding - to test if your approach has merit to explore this further you could work with Historical in Market Replay to simulate starting with a 'fresh' VMA each day.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    52 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X