Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OIF Order Instruction File Questions Change not working

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

    OIF Order Instruction File Questions Change not working

    Here is my log:
    OIF, 'PLACE;SIM101;NQ 12-21;BUY;1;MARKET;0;0;DAY;;9001;;' processing
    OIF, 'CHANGE;;;;1;;16499.75;16369.75;;;9001;;' processing
    OIF, 'CHANGE;;;;1;;16499.75;16369.75;;;9001;;' order with ID/Name '9001' is in a terminated state and can't be changed


    the trade is live, not terminated

    So I send a Place Order and give it an order id ie 9001 , I read the Sim101_9001.txt in the outgoing folder and get the fill price
    I then compute limit and stop prices and send a change order file to the incoming.
    After reading my own post here I am wondering if I am using the correct file??? So I place the trade and the order is complete so how am I actually changing the order??
    My idea is once filled I retrieve the fill price and then send the stoploss and target prices.
    On another thought, if I refer to a specific strategy can I have a trade management strategy running and when the order is filled that it will handle the trade?
    Any ideas on this will be helpful.

    #2
    Hello set2win,

    Thank you for your post.

    You can't change a market order, it's going to fill at the market price as soon as possible. You would need to submit separate Place commands for the stop loss and the profit target, one for each order.

    You could alternatively specify an ATM Strategy name to be sent with the initial market order. The ATM strategy must have been previously created and saved in NinjaTrader before you can use it. Please see the documentaion from our help guide here:

    https://ninjatrader.com/support/help...parameters.htm

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thanks Kate, So PLACE action SELL one for the Limit order and one for the Stoploss , got it. so after creating a specfic atm strategy, ie 3595STP_PTStrat it would know to use that once the market order filled? Also this morning an errant programing issue created over 300 orders in the LiveSim. I know there are limits you can set on instruments, does it not apply to Sim trading?

      Comment


        #4
        Hello set2win,

        Thank you for your reply.

        Yes, if you specify the Strategy Name and a unique Strategy ID it will use that ATM strategy automatically when the entry order fills.

        You can set a risk template for a Sim account that would limit the number of contracts for an instrument. You would need to add this by going to the Accounts Tab, right clicking on the account and selecting Edit Account. In this screen you can choose to use the NinjaTrader Brokerage Default risk template. You can also create a custom risk template from Tools > Risk. Please see this section of our help guide for further information on Risk templates:

        https://ninjatrader.com/support/help...isk_window.htm

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          on placing the stoploss and profit target for along position the language in the OIF should be what?
          I tried:
          OIF, 'PLACE;SIM101;NQ 12-21;SELL;1;LIMIT;0;16118.0;DAY;;9001;;' processing
          Submitting order without strategy...
          OIF, 'PLACE;SIM101;NQ 12-21;SELL;1;LIMIT;16248.0;0;DAY;;9001;;' processing
          One minute after placing the LONG market order which filled
          But it sold the existing order immediately. What am I missing?

          Update: other order types STOPLIMIT STOPMARKET, so using Limit for the profit target, using the other 2 stop options for the stop?
          Last edited by set2win; 11-30-2021, 11:13 AM.

          Comment


            #6
            Hello set2win,

            Thank you for your reply.

            First off, you're using the same Order ID for all three orders - you'll want to make sure each order has a unique id.

            Next, You're trying to place both the stop loss and profit target as Limit orders. Buy limit orders placed below the market would result in an immediate fill. You would want to use StopMarket or StopLimit instead. I would also recommend linking the stop and target with a unique OCO id so that if one is hit and filled the other will be cancelled.

            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by set2win View Post
              So PLACE action SELL one for the Limit order and one for the Stoploss , got it. so after creating a specfic atm strategy, ie 3595STP_PTStrat it would know to use that once the market order filled?
              You're going about this the hard way.

              If you specify the name of the Atm Strategy template
              in the PLACE command, no extra orders are necessary.

              If you're looking to setup a stop & target order and
              OCO them together, then yes, keep working on those
              two extra OIF orders -- but, really, come on, that sure
              seems like a waste of time ... don't you think?

              Your situation screams for the simple solution!

              Just add the Atm strategy name to the PLACE command
              for initial entry order command. The Atm strategy will
              automatically do exactly what you're tying to do manually.

              Just my 2˘.

              Last edited by bltdavid; 11-30-2021, 12:14 PM.

              Comment


                #8
                Yes thanks Kate and thanks bltdavid, I will check these out. I did do the limit and stopmarket today and that seem to work. But the ATM strategy will be best

                Comment


                  #9
                  Looks like bltdavid you are so right. The ATM strategy is the ideal way to accomplish what I was trying to do. Everything is functioning smoothly. I am amazed how quickly NT responds to the OIF file, the fills are very quick. I only wish I could retrieve the close price. Nothing in the outgoing shows the price it exited at.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Bhavika, Yesterday, 09:03 PM
                  1 response
                  4 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by slimcactus, Today, 10:26 AM
                  1 response
                  13 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by Monares, Today, 10:49 AM
                  3 responses
                  17 views
                  0 likes
                  Last Post NinjaTrader_JustinD  
                  Started by d122y, Today, 10:20 AM
                  1 response
                  12 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Started by trader3000a, Today, 06:41 AM
                  1 response
                  15 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X