Object reference not set to an instance... - NinjaTrader Programming | futures io social day trading
futures io futures trading


Object reference not set to an instance...
Updated: Views / Replies:1,580 / 5
Created: by dsraider 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
 

Object reference not set to an instance...

  #1 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

Object reference not set to an instance...

So, I created a painfully simple strat which utilizes nothing but the RSI. When I went to run it on my chart, I got this in the log: Error on calling 'OnBarUpdate' method for strategy 'MyStrategy': Object reference not set to an instance of an object.

I read somewhere that this had to do with nulls BUT here's my code:

 
Code
                            
if (entryOrder1 == null && RSI(71)[1] <= 30 && RSI(71)[0] > 30)        
    {
    
entryOrder1 EnterLong(DefaultQuantity"MyStrategy");
         } 
Opposite for shorts (using the 70 line).

It doesn't get much simpler than that. Also, after doing this, another one of my strats, with which I've never had a problem, starting throwing the same error. Does anyone know if anything else might be causing this? It's just plain weird.

Thanks,
Dave

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)
 Vendor: www.traderwerks.com 
Taipei Taiwan
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Optimus
Favorite Futures: TW
 
Posts: 693 since Jun 2009
Thanks: 440 given, 440 received



dsraider View Post
So, I created a painfully simple strat which utilizes nothing but the RSI. When I went to run it on my chart, I got this in the log: Error on calling 'OnBarUpdate' method for strategy 'MyStrategy': Object reference not set to an instance of an object.

I read somewhere that this had to do with nulls BUT here's my code:

 
Code
                            
if (entryOrder1 == null && RSI(71)[1] <= 30 && RSI(71)[0] > 30)        

    {
    
entryOrder1 EnterLong(DefaultQuantity"MyStrategy");
         } 

Thanks,
Dave

Nothing weird about it. Just look at you code at think about the sequence that things happen when your strat runs.

Reply With Quote
 
  #4 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

Thanks for your reply, traderwerks. Anymore detail on that, though? I haven't done anything different with this one than normal and I definitely don't understand why a strat that's been working perfectly for months suddenly throws an error message every time I try and load it.

Thanks again,
Dave

Reply With Quote
 
  #5 (permalink)
 Vendor: www.traderwerks.com 
Taipei Taiwan
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Optimus
Favorite Futures: TW
 
Posts: 693 since Jun 2009
Thanks: 440 given, 440 received


dsraider View Post
Thanks for your reply, traderwerks. Anymore detail on that, though? I haven't done anything different with this one than normal and I definitely don't understand why a strat that's been working perfectly for months suddenly throws an error message every time I try and load it.

Thanks again,
Dave

I cannot tell you exactly because I just saw a code snippet. Whatever the problem is , just watch what you are doing with the entryOrder. Just walk through the Code and e answer should pop out.

Reply With Quote
 
  #6 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

It was a (bad word here) Draw object.

Thanks for your help.

Dave

Reply With Quote

Reply



futures io > > > > > Object reference not set to an instance...

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
Error: Object reference not set to an instance of an object. gomad NinjaTrader Programming 11 December 22nd, 2014 09:09 AM
object name ? sam028 NinjaTrader Programming 3 March 14th, 2011 10:55 AM
ninja trader object reference not set to an instance kk240 NinjaTrader Programming 4 December 29th, 2010 11:16 AM
need help :: cant fix :: Object reference not set to an instance of an object Trader.Jon NinjaTrader Programming 9 November 3rd, 2010 11:55 AM
EasyLanguage Object Reference philloo TradeStation 2 June 18th, 2010 03:56 AM


All times are GMT -4. The time now is 05:04 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-11 in 0.10 seconds with 19 queries on phoenix via your IP 54.226.132.197