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

how to modify the value of Series<int>

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

    how to modify the value of Series<int>

    In my indicator, I created a Series<int> . and I gave values 1 to some of Series[].

    After get the values, the indicator need to modify the value of some Series<barAgo>, I tried to give 0 to topSeries[tempBarsTwoAgo] agin. like below:

    topSeries[tempBarsTwoAgo]=(0);
    topSeries[tempBarsAgo]=(0);

    But it seems the value didn't go back 0.

    Do I need use reset(tempBarsTwoAgo) to get 0 value?

    #2
    Hello LadGta2018,

    Thank you for your note.

    Without the full code we're unable to test on our end.

    If you'd like to upload the full code I can take a look and see if anything jumps out. Or if you'd prefer to email a copy, send to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the files.

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      my question is how to modify the value of Series. I don't understand why you asking the whole code.
      could you just tell me gernerally how to modify the value of a INT Series?


      Originally posted by NinjaTrader_AlanP View Post
      Hello LadGta2018,

      Thank you for your note.

      Without the full code we're unable to test on our end.

      If you'd like to upload the full code I can take a look and see if anything jumps out. Or if you'd prefer to email a copy, send to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the files.

      I look forward to your reply.

      Comment


        #4
        Hello LadGta2018,

        Attached is an example of how you could set a previous series value to another value. The indicator sets the series on each bar to the closing price. However once we reach the most recent bar, I set the value of the series 5 bars ago, to 5, then print the value of the series 5 bars ago and you’ll see in the output window (Control Center>New>Output), a 5 printed.

        Please let us know if you need further assistance.
        Attached Files
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Thanks a lot.

          Originally posted by NinjaTrader_AlanP View Post
          Hello LadGta2018,

          Attached is an example of how you could set a previous series value to another value. The indicator sets the series on each bar to the closing price. However once we reach the most recent bar, I set the value of the series 5 bars ago, to 5, then print the value of the series 5 bars ago and you’ll see in the output window (Control Center>New>Output), a 5 printed.

          Please let us know if you need further assistance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,605 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          8 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          4 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          13 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X