• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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,
            https://ninjatrader.com/support/help...-us/?order.htm

            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.
            https://ninjatrader.com/support/help...rderupdate.htm

            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 D Trader, Yesterday, 09:43 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by cassiano_sanches, 07-10-2020, 07:37 PM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by terminatorT1000, 07-10-2020, 06:40 PM
            2 responses
            27 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Giudiver, 07-10-2020, 04:29 PM
            2 responses
            16 views
            0 likes
            Last Post Giudiver  
            Started by rtwave, Today, 04:11 PM
            0 responses
            4 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Working...
            X