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

OIF File problems

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

    OIF File problems

    Hello,

    I placed this in a OIF File:
    PLACE;Sim101;ES 09-23;BUY;1;LIMIT;4460.25;0;DAY;;;;

    Attempting to open a buy limit order at 4460.25

    Instead it appears as if a market order is being opened at the current price.

    I have attached the log screenshot and the chart screen shot.

    Can anyone tell me what I am doing wrong ??
    Attached Files

    #2
    Hello bradwalt,

    Thank you for your post.

    The issue with the fill price seems to be with the side of the market the order was on at the time of being submitted; a Buy Limit order should be below the market and a Sell Limit order should be above the market. 4460.25 is the limit price, which was above the market at the time it was submitted so the order instantly filled at market price. Limit orders are designed to fill at the limit price or better, and the market price was a better price resulting in the order being filled.

    For more details on different types of futures orders:


    Please let us know if we may be of further assistance.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Thanks so how can I place an order at 4460.25 to sell when the price action reaches that level or visa versa a buy order if the price action comes down to 4000 ?

      Comment


        #4
        Hello bradwalt,

        Thank you for your reply.

        That ultimately depends on what the last traded price is at the time you submit your orders. If the price were between 4000 and 4460.25, like 4200 for example, then you could set up a condition that submits a sell limit order for 4460.25 and a buy limit order for 4000. In your initial post, it seems that you submitted a buy limit order when the price was already below the limit price; this is why the order was filled immediately in comparison to if you placed a sell limit order at that higher price.

        Please let us know if we may be of further assistance.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          Hello,

          Thanks for you response.

          So how do I submit an buy order above the current price.

          So if the price is 4200 and I would like to submit a buy order when the price hits 4250. What type of order do I place in the OIF file?

          Or a second example would be a sell order .. If the price is 4200 and I would like a sell order when the price reaches 4150. What order type do I place in the OIF file

          Once I can get the correct order opened at the price I will add a strategy to provide a take profit and stop loss.

          Thanks
          Last edited by bradwalt; 07-10-2023, 02:05 PM.

          Comment


            #6
            Hello bradwalt,

            Thank you for your reply.

            You would have to use an order type other than a limit order. For example, you could use Stop-Market orders or Stop-Limit orders. The main difference is that Stop-Market orders fill as a market order, so the fill price is not guaranteed and could fill at a worse price due to slippage. A Stop-Limit order is not guaranteed to fill, though if it does fill it will fill at the limit price or better. I already shared one link about different order types; this link covers the main differences between three basic order types (Limit, Stop-Market, and Stop-Limit):
            Understanding order types is an important step in learning how to trade futures. Learn the function of three basic futures order types.


            The side of the market on which an order should be placed is a general trading concept and is not specific to NinjaTrader. You should be able to find additional information from publicly available resources after doing an internet search if you'd like.

            Please let us know if you have any additional questions or concerns.
            Emily C.NinjaTrader Customer Service

            Comment


              #7
              Hello,

              Thanks I think I understand now..

              Just for clarity can you help me with one more question:

              What would be the line in the OIF file for these 2 order types:

              buy stop
              sell stop

              Each one with a custom strategy called "ABCStrat" and a limit price of 95.5

              Thanks in advance

              Comment


                #8
                Hello bradwalt,

                Thank you for your reply.

                You would follow the PLACE COMMAND shown on this page:
                PLACE;<ACCOUNT>;<INSTRUMENT>;<ACTION>;<QTY>;<ORDER TYPE>;[LIMIT PRICE];[STOP PRICE];<TIF>;[OCO ID];[ORDER ID];[STRATEGY];[STRATEGY ID]

                You would use BUY or SELL for the <ACTION> and then STOPMARKET or STOPLIMIT for the <ORDER TYPE>
                If you are using a stop-market order, only a stop price is required. You mentioned a limit price, if you mean this for a stop-limit order, both a stop price and limit price must be defined.

                For a list of available parameters and valid values:


                Please let us know if we may be of further assistance.
                Emily C.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by fx.practic, 10-15-2013, 12:53 AM
                5 responses
                5,406 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Started by Shai Samuel, 07-02-2022, 02:46 PM
                4 responses
                98 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Started by DJ888, Yesterday, 10:57 PM
                0 responses
                8 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by MacDad, 02-25-2024, 11:48 PM
                7 responses
                160 views
                0 likes
                Last Post loganjarosz123  
                Started by Belfortbucks, Yesterday, 09:29 PM
                0 responses
                9 views
                0 likes
                Last Post Belfortbucks  
                Working...
                X