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

How to view market data in Visual Studio 2019

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

    How to view market data in Visual Studio 2019

    こんにちは、

    忍者トレーダーを接続し、Visual Studio 2019のデバッガーでインタラクティブブローカーの市場データを使用して、市場データを使用してデバッグ するにはどうすればよいですか?

    日本語しか使えません。
    この文章は、Google翻訳でも翻訳されています。

    #2
    Hello kuro6090,

    Below is a link to the connection guide for Interactive Brokers.


    You can attach Visual Studio to the NinjaTrader Process and run scripts and do debugging.
    Below is a link to the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello, ChelseaB

      Thanks, ChelseaB
      I connected to Interactive Brokers and attached to Ninja Trader 7 from Visual Studio 2019.
      However, I am trying to debug by running a strategy on the Ninja Trader 7 chart (9984|TSEJ), but the error shown in the attached image appears.
      Since the value of Close[0] is also "0", I feel that Visual Studio 2019 is not picking up market data.
      The Ninja Trader 7 chart (9984|TSEJ) is correctly connected to the market data and displaying the chart.

      How can I get market data in Visual Studio 2019?
      Attached Files
      Last edited by kuro6090; 07-23-2020, 07:31 AM.

      Comment


        #4
        I've attached an image changed to English.
        The error message is in English below.

        "Object reference not set to an instance of an object."
        Attached Files

        Comment


          #5
          Hello kuro6090,

          The message is telling you there is a null object.

          It will not be possible to call an indicator in the Initialize() method. It will be null as there is no data being processed yet.

          You will need to call the ATR in OnBarUpdate().
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hello, ChelseaB

            Thank you, ChelseaB

            I see, you can't call the indicator inside Initialize.

            How can I get it through OnBarUpdate for debugging?
            Last edited by kuro6090; 07-23-2020, 07:31 AM.

            Comment


              #7
              Hello kuro6090,

              Code:
              protected override void OnBarUpdate()
              {
                  if (CurrentBar == 0)
                  {
                      SetStopLoss("", CalculationMode.Percent, SongiriTesiuu * ATR(ATRLength)[0], true);
                  }
              }
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Excuse me, ChelseaB

                I can only use Japanese.
                So I can't tell you very well.

                I want to stop and debug at a breakpoint in OnBarUpdate, but I can't stop at a breakpoint in OnBarUpdate.

                I think this is because it has never passed OnBarUpdate. How can I get OnBarUpdate to pass?
                Last edited by kuro6090; 07-23-2020, 07:29 AM.

                Comment


                  #9
                  Hello kuro6090,

                  Break points can be hit in OnBarUpdate as the script is running in NinjaTrader.

                  The steps to attach to the debugger are:
                  1. Open project from Documents\NinjaTrader 7\bin\Custom
                  2. Correct NinjaTrader.Core.dll and WilsonORMapper.dll references
                  3. Ensure script is included in project
                  4. Enable debugging mode in NS editor
                  5. Attach VS to NT process
                  6. Compile NS editor (F5)
                  7. Add break point
                  8. Run script
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Hello, ChelseaB

                    Thank you very much!

                    Thanks to that, I was able to see the market data in VS.

                    Thanks to ChelseaB.

                    I'm sorry for the wrong name.
                    I fixed everything.
                    Last edited by kuro6090; 07-23-2020, 07:33 AM.

                    Comment


                      #11
                      Originally posted by NinjaTrader_ChelseaB View Post
                      Hello kuro6090,

                      Below is a link to the connection guide for Interactive Brokers.
                      https://ninjatrader.com/ConnectionGu...nnectionfx robots

                      You can attach Visual Studio to the NinjaTrader Process and run scripts and do debugging.
                      Below is a link to the help guide.
                      https://ninjatrader.com/support/help..._debugging.htm
                      What is refresh interval or it is realtime?
                      Last edited by FXZig; 08-05-2020, 03:50 PM.

                      Comment


                        #12
                        Hello FXZig,

                        Welcome to the NinjaTrader Forums!

                        Are you asking if real-time data from Interactive Brokers is real-time or are you asking kuro6090 if they are looking at historical data or real-time data?
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_ChelseaB View Post
                          Hello FXZig,
                          Are you asking if real-time data from Interactive Brokers is real-time or are you asking kuro6090 if they are looking at historical data or real-time data?
                          I mean in this example https://ninjatrader.com/support/help..._debugging.htm do we have really real-time data? Will be nice if that is true.
                          Thanks for response ChelseaB.

                          Comment


                            #14
                            Hello FXZig,

                            Real-time data comes from your connected broker or data provider.

                            If you are subscribed to real-time data with your broker or data provider, then this would cause OnBarUpdate() to run in real-time, including if you have attached the process to Visual Studio.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Hello, ChelseaB

                              Is this forum charged?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by techgetgame, Yesterday, 11:42 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post techgetgame  
                              Started by sephichapdson, Yesterday, 11:36 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post sephichapdson  
                              Started by bortz, 11-06-2023, 08:04 AM
                              47 responses
                              1,613 views
                              0 likes
                              Last Post aligator  
                              Started by jaybedreamin, Yesterday, 05:56 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post jaybedreamin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              20 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Working...
                              X