Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja Trader V8.0.26 Rithmic issues fixed

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

    Ninja Trader V8.0.26 Rithmic issues fixed

    Hello,

    I see in the documentation you have fixed:
    15048 Added Adapter, Rithmic Updated Rithmic API to version 11.3.0.0
    Can you elaborate on that please?

    Will OnOrderUpdate() OnExecutionUpdate() and OnPositionUpdate() be called in the expected order?


    #2
    Hello roblogic,

    Thanks for your message.

    Yes, the Rithmic Connection Adapter includes an API update. This is done as a quality of life improvement to improve support with Rithmic Sim2Funded/Combine systems.

    I don't have very much to elaborate on, but I an say that the change in API does not change how the Order/Execution/Position updates are sent from Rithmic to NinjaTrader. NinjaTrader is not doing anything extra to queue these events to ensure they come in 1. Order 2. Execution 3. Position sequence - the events can still come in any order.

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      With the 8.26.01 update released yesterday. Is the rithmic event queue for order, positions, execution still an issue? If so, is there any way to code a queue system in the strategy?

      Comment


        #4
        Hello Ja3nyc,

        The fixed issue had to do with handling out of sequence position/PnL updates from the Rithmic API. (You would see an incorrect Long/Short Position reported after you have gone flat.)

        Rithmic still uses separate feeds for Order/Execution/Position events and these events still do not have a deterministic order in NinjaTrade. You will want to be mindful to handle these events separately and to not rely on Order information in OnExectuionUpdate where you would want to handle stop and target submission.

        We have some examples to help navigate. Please see attached.
        Attached Files
        JimNinjaTrader Customer Service

        Comment


          #5
          I appreciate the examples for unmanaged rithmic friendly strategies. You mentioned that you would see incorrect long/short positions reported after being flat and attached is a screenshot with the issue I believe you are talking about on the updated version of ninjatrader. Was this the issue that was fixed or is it something completely different. If so, how would I be able to handle that?

          Thank you,
          John
          Attached Files

          Comment


            #6
            Actually, I took a look at the examples and I see the (State == State.RealTime) that includes
            Code:
            // convert any old historical order object references
            // to the new live order submitted to the real-time account
            if (shortEntry != null)
            shortEntry = GetRealtimeOrder(shortEntry);
            if (longEntry != null)
            longEntry = GetRealtimeOrder(longEntry);
            if (targetLong != null)
            targetLong = GetRealtimeOrder(targetLong);
            if (targetShort != null)
            targetShort = GetRealtimeOrder(targetShort);
            if (stopLossShort != null)
            stopLossShort = GetRealtimeOrder(stopLossShort);
            if (stopLossLong != null)
            stopLossLong = GetRealtimeOrder(stopLossLong);
            This would be the fix to that issue right?

            Comment


              #7
              Hello Ja3nyc,

              The snippet of code is for transitioning historical order objects used in the strategy to realtime order objects.

              The solution which is shown in the examples ensure that stop target handling is done in OnExecutionUpdate, and the average entry price of an order is calculated from the Execution rather than using information from an Order object. (Since the Order object updates from OrderUpdates which are on a separate feed)

              The screenshot you provided just shows the position and account reporting as out of sync. Since it is a Rithmic connection, and Position information drives when the Control Center should update, the information displayed may not be up to date.

              To be certain of Strategy/Account synchronicity on Rithmic and IB connections which do not have deterministic order of events, I suggest drawing the strategy position and account position on the chart:

              Code:
               protected override void OnExecutionUpdate(Cbi.Execution execution, string executionId, double price, int quantity,
                  Cbi.MarketPosition marketPosition, string orderId, DateTime time)
              {
                  Draw.TextFixed(this, "tag1", "Strategy: " + Position.Quantity + " " + Position.MarketPosition.ToString(), TextPosition.TopLeft);
              }
              
              protected override void OnPositionUpdate(Cbi.Position position, double averagePrice,
                  int quantity, Cbi.MarketPosition marketPosition)
              {
                  Draw.TextFixed(this, "tag2", "Account: " + PositionAccount.Quantity + " " + PositionAccount.MarketPosition.ToString(), TextPosition.TopRight);
              }
              This will give you a certain view of the strategy/account position on Rithmic, and you can follow the examples for using the Advanced Order Handling methods and protecting the position with Rithmic
              JimNinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Jim View Post
                Hello Ja3nyc,

                The fixed issue had to do with handling out of sequence position/PnL updates from the Rithmic API. (You would see an incorrect Long/Short Position reported after you have gone flat.)

                Rithmic still uses separate feeds for Order/Execution/Position events and these events still do not have a deterministic order in NinjaTrade. You will want to be mindful to handle these events separately and to not rely on Order information in OnExectuionUpdate where you would want to handle stop and target submission.

                We have some examples to help navigate. Please see attached.
                if I am using strategy builder and I dont know how to code ,I sometimes reverse my position (I just call for long and its supposed to automatically close the short ) and I have had that it would only close my short ,it also does not have the correct contract position ,how can i fix this ?
                I am also using rithmic
                Last edited by yBl123; 12-27-2023, 11:28 AM.

                Comment


                  #9
                  Hello yBl123,

                  Thanks for your notes.

                  As stated by NinjaTrader_Jim, Rithmic uses separate feeds for Order/Execution/Position events and these events do not have a deterministic order in NinjaTrader.

                  When using Rithmic, you should consider following the ManagedRithmicIBFriendly examples that were shared in post # 4 since events do not have a specific order in NinjaTrader when using Rithmic. This does require manually programming your logic in an unlocked script using the NinjaScript Editor window.

                  I suggest studying the ManagedRithmicIBFriendly examples from post # 4 to properly code a strategy that is Rithmic friendly and study the help guide documentation.

                  Below is a link to a forum post with helpful information about getting started with NinjaScript.
                  https://ninjatrader.com/support/foru...040#post786040

                  I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:
                  https://ninjatrader.com/support/help..._resources.htm

                  If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:
                  https://ninjatrader.com/support/help...g_concepts.htm

                  And the MSDN (Microsft Developers Network) C# Language Reference.
                  https://ninjatrader.com/support/help...erence_wip.htm

                  If you need someone to write this script for you on your behalf, you can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script.

                  You can search our extensive library of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more!

                  https://ninjatraderecosystem.com/sea...mming-services

                  Educators - https://ninjatraderecosystem.com/sea...ures=education

                  You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

                  This NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.​​​
                  Brandon H.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by samish18, 04-17-2024, 08:57 AM
                  27 responses
                  116 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by ETFVoyageur, 04-30-2024, 02:04 PM
                  7 responses
                  44 views
                  0 likes
                  Last Post eDanny
                  by eDanny
                   
                  Started by f.saeidi, Today, 07:07 AM
                  5 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by Creamers, 04-27-2024, 05:32 AM
                  9 responses
                  60 views
                  0 likes
                  Last Post Creamers  
                  Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
                  19 responses
                  60 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X