NexusFi: Find Your Edge


Home Menu

 





NT7 to NT8, code change help.


Discussion in NinjaTrader

Updated
    1. trending_up 2,272 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3

I have an NT7 indicator that uses a for loop to set Values.

this is the code for NT7.

double PriceVal = 0;
for (int i = (ATbar - ITbar) - 1; i >= 0; i--)
{
PriceVal += Storage[i];
Values[0].Set(i, PriceVal);
}

I have tried
Values[0][0] = (i, PriceVal);
but all I get is a syntax error.

Again, thanks in advance!


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
SEC Chairman Calls for New Golden Age of SEC-CFTC Regula …
Traders Hideout
Kraken Becomes First US Digital Asset Bank With Direct F …
Cryptocurrency
$500M Riding on World Cup 2026: France/Spain Co-Favored …
Prediction Markets & Event Contracts
UCL Final Kicks Off at Noon ET: PSG at 56.5% as Iran May …
Prediction Markets & Event Contracts
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
5 thanks
  #3 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 649 since Aug 2009
Thanks Given: 320
Thanks Received: 623


As you've noted there is no Set in NT8, the overload your NT7 code was using is following:
 
Code
DataSeries.Set(int barsAgo, double value)
in your new code you probably want this:
 
Code
Values[0][i] = PriceVal;


Reply With Quote
  #4 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3


gregid View Post
As you've noted there is no Set in NT8, the overload your NT7 code was using is following:
 
Code
DataSeries.Set(int barsAgo, double value)
in your new code you probably want this:
 
Code
Values[0][i] = PriceVal;

Thank you for this!
Works great!


Reply With Quote
  #5 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3


gregid View Post
As you've noted there is no Set in NT8, the overload your NT7 code was using is following:
 
Code
DataSeries.Set(int barsAgo, double value)
in your new code you probably want this:
 
Code
Values[0][i] = PriceVal;

Maybe I should do a new post, but would

DoubleSeries.Set(PriceVal);
be the same as
DoubleSeries[0] = PriceVal; // ?


Reply With Quote
  #6 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 649 since Aug 2009
Thanks Given: 320
Thanks Received: 623

Yes

Sent using the NexusFi mobile app


Reply With Quote
Thanked by:




Last Updated on November 5, 2016


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts