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

Newbie questions

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

    Newbie questions

    Hope these aren't too basic:

    1. How do I disable 'Exit on session close' for a strategy?

    Orders:
    1. My strategy creates the stop and limit order in State.Configure:
    A. Are the stop and limit orders all them same position when I loop through Order[i]?
    B. Why would there be a market order in the Orders collection? It was always the first ordertype.

    Print("Order Count: " + Orders.Count());

    for (int z = 0; z < Orders.Count(); z++)
    {
    Print(Orders[z].OrderTypeString);
    }

    C. Why is there still Orders in the order collection after the position is closed? I looped through the orders collection and even after my position was closed and the orders cancelled it kept showing order info.

    I did all this testing using the playback connection.

    Thanks!

    #2
    I found 'Exit on session close'.

    Where can I read more about 'Stop and Target submission' options.

    Thanks!!

    Comment


      #3
      Can someone help?

      Thanks!!

      Comment


        #4
        Hello Mrmistermike2016,

        Thank you for writing in and thank you for your patience.

        The Orders collection is undocumented in the helpguide so I would not be able to comment on what is expected.

        What is your objective exactly?

        I look forward to your reply.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          I want to be able to keep track of open orders. If there is a better, documented method than please tell me.

          Thanks!

          Comment


            #6
            Hello mrmistermike2016,

            Yes, you could use order objects and assign orders names for which you could check the status of.
            I would suggest reading about order objects,


            I’d also suggest OnOrderUpdate for an example and information on assigning an order a name and an order object, then using it to test if the order is filled, cancelled, etc.


            I have also attached a sample strategy which will print to the output window when a specific order named “myEntryOrder” is filled. Please see attached.

            Please let us know if you need further assistance.
            Attached Files
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by tsantospinto, 04-12-2024, 07:04 PM
            4 responses
            61 views
            0 likes
            Last Post aligator  
            Started by michi08, 10-05-2018, 09:31 AM
            3 responses
            740 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by sightcareclickhere, Today, 01:55 PM
            0 responses
            1 view
            0 likes
            Last Post sightcareclickhere  
            Started by Mindset, 05-06-2023, 09:03 PM
            9 responses
            259 views
            0 likes
            Last Post ender_wiggum  
            Started by Mizzouman1, Today, 07:35 AM
            4 responses
            18 views
            0 likes
            Last Post Mizzouman1  
            Working...
            X