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 WHICKED, Today, 02:02 PM
          0 responses
          3 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by selu72, Today, 02:01 PM
          0 responses
          0 views
          0 likes
          Last Post selu72
          by selu72
           
          Started by f.saeidi, Today, 12:14 PM
          8 responses
          21 views
          0 likes
          Last Post f.saeidi  
          Started by Mikey_, 03-23-2024, 05:59 PM
          3 responses
          49 views
          0 likes
          Last Post Sam2515
          by Sam2515
           
          Started by Russ Moreland, Today, 12:54 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Erick  
          Working...
          X