Need confirmation of NT code please - NinjaTrader Programming | futures io social day trading
futures io futures trading


Need confirmation of NT code please
Updated: Views / Replies:1,269 / 4
Created: by Saroj 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
 

Need confirmation of NT code please

  #1 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

Need confirmation of NT code please

Here's some code in an indicator that I am trying to understand (Cycle_Identifier):
============================================
int rnglength = 250;
// pLength is set to 3

double range = 0.0, srange = 0.0;
int j=0;
for (int i=0;i<rnglength;i++) {
if(i>=CurrentBar) break;
j++;
srange = srange + (High[i] - Low[i]);
}
range = srange / j * pLength;
====================================================

1) Looks to me like for each bar, the indicator is recalculation for the last 250 bars, the cumulative bar range (H - L) / 750

Is that right?

2) the code tests to be sure there are at least 250 bars on chart
(if(CurrentBar<rnglength) return; ),
so why is "if(i>=CurrentBar) break;" necessary?

Reply With Quote
 
  #2 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,218 since Jun 2009
Thanks: 628 given, 6,315 received
Forum Reputation: Legendary

1) it calculates average range of the last 250 bars x 3;
2) my guess is code blew up when bar < 250
then other code was put in to fix that error but the old code didn't get taken out.

Reply With Quote
The following user says Thank You to cory for this post:
 
  #3 (permalink)
 Vendor: www.innovative-trading-solutions-online.com 
Hartford, CT. USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG, Kinetick
Favorite Futures: TF
 
RJay's Avatar
 
Posts: 677 since Jun 2009
Thanks: 726 given, 740 received



Saroj View Post
Here's some code in an indicator that I am trying to understand (Cycle_Identifier):
============================================
int rnglength = 250;
// pLength is set to 3

double range = 0.0, srange = 0.0;
int j=0;
for (int i=0;i<rnglength;i++) {
if(i>=CurrentBar) break;
j++;
srange = srange + (High[i] - Low[i]);
}
range = srange / j * pLength;
====================================================

1) Looks to me like for each bar, the indicator is recalculation for the last 250 bars, the cumulative bar range (H - L) / 750

Is that right?

2) the code tests to be sure there are at least 250 bars on chart
(if(CurrentBar<rnglength) return; ),
so why is "if(i>=CurrentBar) break;" necessary?

Saroj,

This should not be needed in the NT programming. ( My Opinion!!!)

Are the results the same with it commented out??

On another note, I have a big problem with the " range = " line..

---------------------------------------------------------------

range = srange / j * pLength;

--------------------------------------------------------------


Needs brackets above the multiplier or below the divisor?????

No exception for "j" or "pLength" being equal to zero.


RJay

Reply With Quote
The following 2 users say Thank You to RJay for this post:
 
  #4 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

The formula should be "range = (srange / j) * pLength+.000001;" (which I have changed it to); or simply not allow a value of pLength = 0; it is initialized to '3' but user changeable.

however it strikes me as very inefficient. First off, for a range chart, it will remain virtually constant (esp across 250 bars); secondly, even on a tick, volume or minute bar, could one calculate srange by subtracting the value 250 bars ago and adding in the current value rather than summing 250 values on each bar?

Reply With Quote
 
  #5 (permalink)
 Vendor: www.innovative-trading-solutions-online.com 
Hartford, CT. USA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: AMP/CQG, Kinetick
Favorite Futures: TF
 
RJay's Avatar
 
Posts: 677 since Jun 2009
Thanks: 726 given, 740 received


Saroj View Post
The formula should be "range = (srange / j) * pLength+.000001;" (which I have changed it to); or simply not allow a value of pLength = 0; it is initialized to '3' but user changeable.

however it strikes me as very inefficient. First off, for a range chart, it will remain virtually constant (esp across 250 bars); secondly, even on a tick, volume or minute bar, could one calculate srange by subtracting the value 250 bars ago and adding in the current value rather than summing 250 values on each bar?

Saroj,

Good luck with this!!

I have so much on my plate right now with my volume watch projects.

Maybe someone else could assist.

RJay

Reply With Quote

Reply



futures io > > > > > Need confirmation of NT code please

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
Serialising thread/code samples from NT forum cclsys NinjaTrader Programming 2 October 22nd, 2013 06:56 PM
Comstock partners: More Confirmation Of The Economic Slowdown kbit News and Current Events 0 May 29th, 2011 12:22 PM
Convert this NT code to EL, Please lizmerrill EasyLanguage Programming 8 January 20th, 2011 02:33 PM
abundant confirmation cory Off-Topic 3 November 25th, 2010 04:55 AM


All times are GMT -4. The time now is 06:45 PM.

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-13 in 0.14 seconds with 19 queries on phoenix via your IP 54.90.92.204