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 cmoran13, Yesterday, 01:02 PM
    0 responses
    27 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    18 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    160 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    95 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    148 views
    2 likes
    Last Post CaptainJack  
    Working...
    X