Missing Declarations - NinjaTrader Programming | futures io social day trading
futures io futures trading


Missing Declarations
Updated: Views / Replies:567 / 9
Created: by cutzpr Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Missing Declarations

  #1 (permalink)
Elite Member
United States
 
Futures Experience: None
Platform: MT4,TWS,Ninja Trader
Favorite Futures: Forex
 
cutzpr's Avatar
 
Posts: 20 since Apr 2012
Thanks: 6 given, 1 received

Missing Declarations

I'm new to c# and NJ script.

I am trying use different methods to work with arrays, take for instance the max, min and length of an array. I see that there are methods such as
 
Code
                            
array.max  
array.min
array.length 
which are found in system.int32 and System.array. How do I add these references to NJ. I would guess they are automatically included.

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Omer עומר / Israel י
 
Futures Experience: Master
Platform: NinjaTrader, Proprietary,
Broker/Data: Ninjabrokerage/IQfeed + Synthetic datafeed
Favorite Futures: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
 
rleplae's Avatar
 
Posts: 2,489 since Sep 2013
Thanks: 1,704 given, 3,694 received
Forum Reputation: Legendary


what are you trying to do ?

Reply With Quote
The following user says Thank You to rleplae for this post:
 
  #4 (permalink)
Market Wizard
Sarasota FL
 
Futures Experience: Intermediate
Platform: NinjaTrader, Sierra Chart
Favorite Futures: ES
 
Posts: 3,635 since Jan 2013
Thanks: 26,754 given, 11,113 received
Forum Reputation: Legendary


cutzpr View Post
I'm new to c# and NJ script.

I am trying use different methods to work with arrays, take for instance the max, min and length of an array. I see that there are methods such as
 
Code
                            
array.max  
array.min
array.length 
which are found in system.int32 and System.array. How do I add these references to NJ. I would guess they are automatically included.

By "NJ" do you mean "NT" (NinjaTrader)?

When you run the NT New Indicator wizard, it will write out a stub indicator that you can modify, and it will put these "using" declarations into the code, which is how references to different namespaces are added in C#:

#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion

If you ever need to reference anything else, you put in the appropriate "using" statement.

If you're not familiar with C# development, I would do some work to get familiar with developing code there, and then dig through some of the code for the standard NT indicators, plus the Help file on NinjaScript, to see what classes are provided and how things are implemented.

Good luck.

Bob.

Reply With Quote
 
  #5 (permalink)
Elite Member
United States
 
Futures Experience: None
Platform: MT4,TWS,Ninja Trader
Favorite Futures: Forex
 
cutzpr's Avatar
 
Posts: 20 since Apr 2012
Thanks: 6 given, 1 received

I tried to add System.Int32 and System.Array in the declarations but they are unavailable in the NJ editor. Please take a look at the image to see what I am talking about.

I should also add I am using NT 8


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #6 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,573 given, 3,982 received


cutzpr View Post
I tried to add System.Int32 and System.Array in the declarations but they are unavailable in the NJ editor. Please take a look at the image to see what I am talking about.

I should also add I am using NT 8


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

You don't need additional libraries.
To declare an array just add the square brackets ([]) after the object type:
 
Code
                            
int[] numbers = new int[5];

Print(
"len: " numbers.Length

Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following user says Thank You to sam028 for this post:
 
  #7 (permalink)
Market Wizard
Sarasota FL
 
Futures Experience: Intermediate
Platform: NinjaTrader, Sierra Chart
Favorite Futures: ES
 
Posts: 3,635 since Jan 2013
Thanks: 26,754 given, 11,113 received
Forum Reputation: Legendary


cutzpr View Post
I tried to add System.Int32 and System.Array in the declarations but they are unavailable in the NJ editor. Please take a look at the image to see what I am talking about.

I should also add I am using NT 8

Obviously, I should have asked before offering advice, since I have not gotten into NT8 yet and am not familiar with its editor. Apologies for that.

However, in general I assume you can just type in any appropriate using statement in the NT8 editor and it should compile.

I see that @sam028 has already given the answer, which I wasn't thinking of because I was focused on the "usings".... Duh.

Bob.

Reply With Quote
 
  #8 (permalink)
Elite Member
United States
 
Futures Experience: None
Platform: MT4,TWS,Ninja Trader
Favorite Futures: Forex
 
cutzpr's Avatar
 
Posts: 20 since Apr 2012
Thanks: 6 given, 1 received


sam028 View Post
You don't need additional libraries.
To declare an array just add the square brackets ([]) after the object type:
 
Code
                            
int[] numbers = new int[5];

Print(
"len: " numbers.Length

I wanted to find the length of a given array/series and also be able to get the array position with the highest number and lowest number without have to use a loop to go through the entire series.

Reply With Quote
 
  #9 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,573 given, 3,982 received


cutzpr View Post
I wanted to find the length of a given array/series and also be able to get the array position with the highest number and lowest number without have to use a loop to go through the entire series.

You can try something like this:

 
Code
                            
int[] numbers = new int[5];

...
Print(
"len: " numbers.Length
int indexAtMax numbers.ToList().IndexOf(numbers.Max());
int indexAtMin numbers.ToList().IndexOf(numbers.Min()); 

Success requires no deodorant! (Sun Tzu)
Reply With Quote
 
  #10 (permalink)
Elite Member
United States
 
Futures Experience: None
Platform: MT4,TWS,Ninja Trader
Favorite Futures: Forex
 
cutzpr's Avatar
 
Posts: 20 since Apr 2012
Thanks: 6 given, 1 received



sam028 View Post
You can try something like this:

 
Code
                            
int[] numbers = new int[5];

...
Print(
"len: " numbers.Length
int indexAtMax numbers.ToList().IndexOf(numbers.Max());
int indexAtMin numbers.ToList().IndexOf(numbers.Min()); 

Thanks @sam028. For some reason the . Length was not working for me.

Reply With Quote

Reply



futures io > > > > > Missing Declarations

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
missing trades ctmvas Psychology and Money Management 18 December 11th, 2015 01:08 PM
Am I missing something? brags Beginners and Introductions 17 October 26th, 2015 07:21 AM
Not missing the boat...as in how to TemporarySanity Beginners and Introductions 9 August 19th, 2014 02:23 PM
missing data? arnie Sierra Chart 0 July 18th, 2013 06:21 AM
Missing link gregid Feedback and Announcements 2 February 27th, 2011 12:21 AM


All times are GMT -4. The time now is 02:40 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-14 in 0.12 seconds with 19 queries on phoenix via your IP 54.221.76.68