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

Data values resetting

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

    Data values resetting

    Hi,

    I've got an Indicator that is placing values into several (3) DataSeries objects. Using Print statements I can see that when the Indicator is run everything works fine, the DataSeries objects properly populate using the .Set() command with the correct values.

    I'm running a Strategy that is to take those 3 DataSeries values into it, however it seems (again using Print statements) that the values for those 3 DataSeries objects are being set to "0" when used in the Strategy...I don't know why. I've done this sort of thing dozens of times before without any issue (using Indicator values within a Strategy).

    The only difference here is that both the Indicator and Strategy are running using "timers", the Indicator processes first to determine/set the values, then the Strategy runs a short time after...in my testing there is no "overlap" in time at all so I wouldn't think that is the cause of the problem, however it must be related somehow...ideas?

    #2
    Anytime OnBarUpdate() is called, if you do not set the value, it is reset. Thus, there are likely times where the values are being reset.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thank you. Let me clarify, this is happening within the same bar...so, for example, on a 5 minute bar both the Indicator and Strategy begin running, but both are also on timers. When the Indicator "completes" setting the values after say 2 minutes they should then be available to the Strategy (before the bar updates to the next bar) correct?

      Comment


        #4
        Yes, I would think but I don't know what you are doing. Somewhere its being reset. I can only say that.
        RayNinjaTrader Customer Service

        Comment


          #5
          Well, perhaps "reset" is not entirely accurate. As stated before, I know the values are perfectly correct within the Indicator...but they are not passing correctly to the Strategy. Is there any reason why a Timer could cause this?

          Comment


            #6
            Unfortunately I would not know.
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Today, 06:40 PM
            0 responses
            9 views
            0 likes
            Last Post algospoke  
            Started by maybeimnotrader, Today, 05:46 PM
            0 responses
            7 views
            0 likes
            Last Post maybeimnotrader  
            Started by quantismo, Today, 05:13 PM
            0 responses
            7 views
            0 likes
            Last Post quantismo  
            Started by AttiM, 02-14-2024, 05:20 PM
            8 responses
            168 views
            0 likes
            Last Post jeronymite  
            Started by cre8able, Today, 04:22 PM
            0 responses
            10 views
            0 likes
            Last Post cre8able  
            Working...
            X