Ninja Trader BUG Open[0] and Close[0] - NinjaTrader Programming | futures io social day trading
futures io futures trading


Ninja Trader BUG Open[0] and Close[0]
Updated: Views / Replies:3,475 / 17
Created: by Warren B. Attachments:5

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
 5  
 
Thread Tools Search this Thread
 

Ninja Trader BUG Open[0] and Close[0]

  #11 (permalink)
Elite Member
BERLIN - Germany
 
Futures Experience: Advanced
Platform: Sierra, Esignal, (NT)
Favorite Futures: FDAX, 6E , Stocks/ETFs
 
Posts: 48 since Nov 2009
Thanks: 45 given, 44 received

Ok. I post it there.

Reply With Quote
 
  #12 (permalink)
Elite Member
BERLIN - Germany
 
Futures Experience: Advanced
Platform: Sierra, Esignal, (NT)
Favorite Futures: FDAX, 6E , Stocks/ETFs
 
Posts: 48 since Nov 2009
Thanks: 45 given, 44 received

Hey,

it was just a programming issue !!!

Here is the right code if someone has the same problem:

if ( Math.Abs(Close[0] - Open[0]) < TickSize * 0.5 )
BarColor = Color.Yellow;

Thanks goes to roonius!!!


Reply With Quote
The following user says Thank You to Warren B. for this post:
 
  #13 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received


here the solution - posted by roonius :

It is double.Epsilon issue.

You can try replacing your condition like this:

if ( Math.Abs(Close[0] - Open[0]) < TickSize * 0.5 )
BarColor = Color.Yellow;

double.Epsilon is C# thing when dealing with double values - you have to be careful when comparing them.

http://bytes.com/topic/c-sharp/answe...double-epsilon

__________________
www.TradingStudies.com


ThanX,
very interesting !

anymore easy to understand expalainations for this ?

max-td
Reply With Quote
 
  #14 (permalink)
Elite Member
Calcutta, India
 
Futures Experience: Intermediate
Platform: ArthaChitra
 
Posts: 278 since Jun 2009
Thanks: 161 given, 259 received

while programming for an vb.net app i had a hell of a time before realizing this. then treated the price variable as Decimals.

Reply With Quote
The following user says Thank You to bukkan for this post:
 
  #15 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received

do i have the same problems if i do it like this :

double open = Open[0]
double close= Close[0]


if ( close == open )
BarColor = Color.Yellow;

??

max-td
Reply With Quote
 
  #16 (permalink)
 Vendor: www.tradingstudies.com 
Denver, CO
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: TF, ES, CL
 
roonius's Avatar
 
Posts: 132 since Jun 2009
Thanks: 20 given, 272 received


max-td View Post
do i have the same problems if i do it like this :

double open = Open[0]
double close= Close[0]


if ( close == open )
BarColor = Color.Yellow;

??

You will have the same problem, if you do like this.
NinjaTrader has an undocumented method (so they are aware of this of course)

if(Instrument.MasterInstrument.Compare(Open[0], Close[0]) == 0)
BarColor = Color.Yellow;

public int Compare(double price1, double price2)
Member of
NinjaTrader.Cbi.MasterInstrument
Summary:
Compares 2 prices with respect to the NinjaTrader.Cbi.MasterInstrument.TickSize to ensure accuracy when dealing with floating point precision.
Parameters:
price1:
price2:
Returns:
1: If price1 is greater than price2, -1: If price1 is less than price2, 0: If price1 is equal to price2

Reply With Quote
The following 3 users say Thank You to roonius for this post:
 
  #17 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received


roonius View Post
NinjaTrader has an undocumented method (so they are aware of this of course)

if(Instrument.MasterInstrument.Compare(Open[0], Close[0]) == 0)
BarColor = Color.Yellow;


so this is also a working solution simular to your own sugestion, roonius ?

max-td
Reply With Quote
 
  #18 (permalink)
 Vendor: www.tradingstudies.com 
Denver, CO
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: TF, ES, CL
 
roonius's Avatar
 
Posts: 132 since Jun 2009
Thanks: 20 given, 272 received


max-td View Post
so this is also a working solution simular to your own sugestion, roonius ?

Yes - it is another working solution.

Reply With Quote
The following user says Thank You to roonius for this post:

Reply



futures io > > > > > Ninja Trader BUG Open[0] and Close[0]

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot open new chart in ninja trader traderandreas NinjaTrader 7 November 2nd, 2016 09:45 PM
Bug in Ninja Trader time and sales? Bob324 NinjaTrader 5 July 8th, 2011 11:20 AM
Volitility indicator question - Open - Open / open - close / close to open andresimon NinjaTrader 2 September 27th, 2010 01:33 AM
MedianRenko close/open hawks67 NinjaTrader Programming 14 July 19th, 2010 01:38 PM
Another Bug in Ninja 7 Michael.H NinjaTrader 16 June 30th, 2010 01:02 PM


All times are GMT -4. The time now is 05:55 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-12 in 0.11 seconds with 20 queries on phoenix via your IP 54.167.44.32