Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

MultiSeries Indicators - Lag

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

    MultiSeries Indicators - Lag

    When adding a second bar series to an indicator the first bar series (BarsInProgress == 0) is executed prior to the second bar series, in case that the bar's time stamps are identical.

    Usually the second bar series however is used to process data, which then is used by the primary bar series. So it would makes sense to reverse the order of bar processing:

    - first process the secondary bars
    - then process the primary bars, which use the information generated by the secondary bars

    I have coded a very simple indicator, which adds a 1-minute bar series to a primary bar series. The problem is that bar processing in this order causes a lag of 1 bar, which can be easily demonstrated on a 1 min chart.

    Is there a workaround to reverse the order of bar processing?
    Attached Files

    #2
    Hello,

    There is no workaround in code. You would only be able to manually change this by starting the strategy on the data series your currently using as the secondary series and reversing it this way.

    Let me know if I can be of further assistance.

    Comment


      #3
      Thanks for your answer Brett.

      It was my limited understanding of how the OnBarUpdate() process works. I thought about it again and have found a simple solution. I just need to set the DataSeries values in the end. So there is no problem at all. Guess, I had to write down the question to find the answer.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      148 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      5 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      5 views
      0 likes
      Last Post tkaboris  
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,282 views
      0 likes
      Last Post Leafcutter  
      Working...
      X