NinjaTrader Crash Recovery - NinjaTrader Programming | futures io social day trading
futures io futures trading

NinjaTrader Crash Recovery
Updated: Views / Replies:3,587 / 12
Created: by TraderDJB Attachments:1

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

Thread Tools Search this Thread

NinjaTrader Crash Recovery

  #11 (permalink)
Elite Member
Futures Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 798 since Jun 2009
Thanks: 109 given, 786 received

TraderDJB View Post
Right, that's the info displayed in the control panel tabs.

You will see an instance in cache (for want of a better word) for every enable/disable/enable cycle of each strategy, and GC does not clear it.

Reply With Quote
  #12 (permalink)
Elite Member
Futures Experience: Intermediate
Platform: NinjaTrader, TradeStation, Thinkorswim
Broker/Data: MB Trading
Favorite Futures: Forex
TraderDJB's Avatar
Posts: 46 since Jan 2010
Thanks: 7 given, 28 received

I've been trying to get to the list produced by the Strategy Analyzer in a similar fashion to no avail, as well as...

// There is only 1 in this.Strategies, so this doesn't work...
//foreach (StrategyBase strategy in this.Strategies)
// Strategy.Print("Profit Factor: " + strategy.Performance.AllTrades.TradesPerformance.ProfitFactor);

Have you had any success in this?

Do or do not, there is no try. - Yoda
Reply With Quote
  #13 (permalink)
Just starting out...
Futures Experience: Intermediate
Platform: MT4, NT7
Posts: 4 since Aug 2010
Thanks: 1 given, 0 received

TraderDJB View Post
Update: I have successfully accessed from within the strategy the global values that are listed in the Executions, Positions, and Accounts tabs using this code:

// To access Executions or Accounts, replace "Positions" with the appropriate change.
                Print("Positions: " + Account.Positions.Count);
                System.Collections.IEnumerator Test = Account.Positions.GetEnumerator();
                for (int i = 0; i < Account.Positions.Count; i++)
                    Print("Current" + Test.Current);
It seems that the current status of the broker isn't kept into separate orders that the strategy placed but rather is the running sum. So, I'll have to have the strategy infer based on the current quantity and direction (long/short) where it is at then it will know for sure. Since it uses multiple orders of fixed sizes, it won't be hard to infer how many it has active to match the broker position.

It still doesn't solve how to recreate the IOrder... but I suppose the strategy doesn't need to, it could keep track at that point by something else instead of IOrder == null...... more updates to come.

Interesting thread and it's something that has been on my mind as I've been trying to learn NT7 over the last few weeks. This stuff is important not just for crash handling but in the event of power failure/etc too where you want to resume the trade. After NT7 restarts after a crash/reboot, will the strategy remain in the Strategies tab and be checked Enabled?

Bear in mind I'm still new to NT and maybe this is new to NT7 also but I can see Account.Orders in there which is an OrderCollection. Give that you know already (or at least you should!) what the order signal name is for a given strategy you should be able to query each order in the collection, match its status and signal name to retrieve it.

In this code example I'm just guessing that you can cast to IOrder from the OrderCollection. When I did backtesting using the following code I found the count was always 0, which I suppose is understandable for a backtest, but it didn't really answer my question properly. Maybe someone with a live trading account can give it a shot?

System.Collections.IEnumerator Test = Account.Orders.GetEnumerator();
                for (int i = 0; i < Account.Orders.Count; i++)
                    IOrder TestOrder = (IOrder) Test.Current;
                    Print("Current " + Test.Current);
Aside from that I'm being careful to avoid any loose-hanging variables that are set on the fly that would need to be re-filled during the OnStartUp() after you've got the orders back out of the collection. And personally I don't really like that practice anyway.

Reply With Quote


futures io > > > > > NinjaTrader Crash Recovery

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash Crash Documentary Ryanb Traders Hideout 6 February 11th, 2017 04:51 PM
Was Last May's 'Flash Crash' Actually Caused by the SEC? Quick Summary News and Current Events 0 September 15th, 2010 11:50 AM
NT7 Problem after Computer Crash britkid99 NinjaTrader 13 August 23rd, 2010 05:35 PM
Why many knew about the crash a few weeks back .... webart The Elite Circle 7 June 2nd, 2010 04:38 PM
Happy 80th birthday 1929 crash shodson Traders Hideout 0 October 27th, 2009 04:01 PM

All times are GMT -4. The time now is 01:56 PM.

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
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 2018-05-27 in 0.09 seconds with 20 queries on phoenix via your IP