Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Strategy does not work anymore

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Strategy does not work anymore

    Hello, My strategy does not work today. It looks like the1 minute chart displays 5 minutes instead in historical data. I do not know it is IB's new policy or it is something goes wrong with the software. Anyone has some ideas? Thank you!

    #2
    Hello atrader,

    Thanks for your post.

    Strategies will need to run on data, so we should first make sure the data is loaded appropriately.

    Please make sure you have updated NinjaTrader, and are using the version of TWS/IB Gateway that we provide in our Connection Guide. We should use there versions for the best experience and as they are tested well to work with NinjaTrader. Other versions may lead to unexpected results.

    Update NinjaTrader - https://ninjatrader.com/PlatformDirect

    Connection Guide - https://ninjatrader.com/ConnectionGu...nnection-Guide

    After making sure you are connected with these versions, please try right clicking on the chart and selecting Reload All Historical data to reload the data on the chart, and attempt enabling the strategy.

    If there are issues here, please elaborate:

    1. Are there any errors in the log tab of the Control Center?
    2. Does the strategy disable on its own?
    3. Is the strategy yellow or green in the Strategies tab of the Control Center?
    4. When you add debugging prints and test again, are your order submission methods being reached?

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello Jim, Thank you so much for your reply. The detailed information as below.
      1. NT version 8.0.25.0 and TWS Build 981.3g
      2. It is working good before today.
      3. My strategy uses 1 minute, 5 minutes and 15 minutes data. I have logs in the strategy to log in all those information. But the 1 minute information is missing for historical data. I checked the Charts also. It happens on NQ, ES and stocks such as aapl. It is good for VIX.
      4. During connecting to IB, there is a message in the log tab as "Instrument NQ 03-22 Globex is not enabled to receive real-time data. Please add the instrument to your IB account data subscriptions. Error: Requested market data is not subscribed. Delayed market data is not available. NQ MAR'22/DEEP". I have NQ in IB and the error message is always there and it does not affect the strategy's working before. And no error message for ES and aapl, but there is no 1 minute historical data for them too.
      5. The strategy still run, but it does not run properly because of there is no 1 minute historical data.
      Thank you so much!

      Comment


        #4
        Hello atrader,

        Delayed data from Interactive Brokers is not supported with Interactive Brokers, and you are using the versions of NinjaTrader and TWS that we recommend. The error is telling us that the data needed is unavailable.

        It is possible the a change to your data enablements on your account has resulted in this situation.

        Since we are still looking at data, and there are errors noting data, we suggest reaching out to Interactive Brokers to confirm your data enablements and to make sure you have access to historical minute data and that you have realtime data enabled as well with your account. (Regular realtime data, non-delayed.)

        After confirming you have the correct data enablements with IB, please restart NinjaTrader and test opening the charts to make sure the data is present and can be loaded.

        Once we are squared away with historical and realtime data, you should be able to use the strategy again.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hello Jim, Thank you so much for your reply. I think that it is because something wrong with IB because ES is OK, but NQ can only display 3 days' 1 minute data. However, because of this, The strategy does not work properly. The reason is that the close trade before market close could not be done by the strategy instead it was done by the internal "exit on session close" function. This makes the strategy still think there is an open order because the "exit on session close" function might have a different EntrySignal. The error message says "This was an exit order but no position exists to exit" on the next day and the message keeps going forever.
          My questions are:
          1. Is there a way that I can modify the internal function "exit on session close" so that I can use the EntrySignal I created for the entry order?
          2. Is there a way to save the 1 minute data so that when I connect to IB, it can use that data if IB could not provide it?
          Thank you so much again!

          Comment


            #6
            Hello atrader,

            It is possible to save real-time data as historical tick data, however, this does not save as minute data. There would be an extra task of exporting the tick data and re-importing it with the General minute data option checked.


            That said, the Exit on close is an event that would occur if there is an open position at the end of the session when this is enabled.

            Below is a link to a forum post that demonstrates the behavior.
            NinjaTrader Community, A common inquiry is that the Exit on close didn't work in a NinjaScript Strategy because there is a position after the exit on close should have occurred. When viewing the log we often find that the Exit on close does indeed exit the position shortly before the end of the session (based on the Exit on


            The 'Exit on session close' and 'Exit on session close seconds', can be disabled or modified in the Strategies window in the strategy parameters.


            This comes down to real-time and historical data. With Interactive Brokers, if there is no real-time subscription for the instrument the strategy is not going to run and historical data is not going to load on the chart.

            Please ensure in TWS that the data is not delayed, or please reach out to your broker to subscribe to the instrument.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by poplagelu, Today, 05:00 AM
            0 responses
            3 views
            0 likes
            Last Post poplagelu  
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,407 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            98 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            8 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            161 views
            0 likes
            Last Post loganjarosz123  
            Working...
            X