NexusFi: Find Your Edge


Home Menu

 





NT7 to NT8, code change help.


Discussion in NinjaTrader

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




 
Search this Thread

NT7 to NT8, code change help.

  #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?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
Quant vue
Trading Reviews and Vendors
REcommedations for programming help
Sierra Chart
 
  #3 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 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: 650 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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts