Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop loss and take profit for orders with OIF files

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

    #16
    Originally posted by NinjaTrader_ChelseaB View Post
    Hello Bruce,

    This wouldn't be something that could be accomplished with OIF files.

    edited

    If your application is where you are triggering actions from keypresses, the application could copy an OIF file into the incoming directory..
    Thanks for your reply Chelsea I missed it when you sent it. Just to clarify. My application is triggering a visual marker to BUY/SELL on my chart which in turn prompts me to manually press my F4/F9 keys which then places the NT ATM entry working orders based on those respective hot keys.

    What I'm wondering is if its possible to write a txt output in my app to the appropriate directory in NT that will automate the F4/F9 key presses; rather than me manually hitting those respective keys on my keyboard. The only thing my application is doing is painting a marker on my chart but it is capable of sending a txt message to any directory on my computer......So is it possible to create a OIF txt message that will tell NT to activate my F4/F9 hot keys (at the same time it paints a marker on my chart) rather than me pressing them on my keyboard manually?

    Thanks
    Bruce

    Comment


      #17
      Hello Bruce,

      Unfortunately, this is not possible with OIF (Order-Instruction-Files). These are for submitting orders only.

      I would recommend that you create a NinjaScript Indicator if you want to do something like this.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Is it possible for the STOPMARKET orders in the oif files to be trailing?

        Comment


          #19
          Hello jeremyed,

          Welcome to the NinjaTrader forums!

          Not for orders directly sent through OIF.

          However, if you specify an Atm template that has a stop strategy saved in it, this will be effective on the stop loss created by the Atm.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            Not for orders directly sent through OIF.

            However, if you specify an Atm template that has a stop strategy saved in it, this will be effective on the stop loss created by the Atm.
            ​I was looking at the templates and wasn't sure if I could programmatically enter trades. Currently I'm running a custom program that writes the OIF files when necessary and each trade has its own stop loss percentage in the moment. From what I've seen the templates are "hard coded". Is that correct or is there a way for the stop order template to create a stop behavior with the percentage specified?

            Thanks,
            Jeremy

            Comment


              #21
              Hello Jeremy,

              Atm's can have the 'Parameter type' set to 'Percent' for the initial distance as a percent of the entry price.


              However, this only applies to the initial distance and not trailing behavior.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #22
                So let me know if I have this straight. My aim is to create an order with target and stop and have the stop trail. For now I have an ATM Strategy that has a custom stop template with trailing behavior. So I can create an Oif* file with the PLACE command for that order and the defaulted target and stops are set. Then to change them to what I would like I create another Oif* file with a CHANGE command for the Target1 and the Stop1 giving the strategy Id that was initially passed to the PLACE command. Does this sound proper or could I do this in one Oif* file?

                Thanks

                Comment


                  #23
                  Hello jeremyed,

                  Yes, you can use the CHANGE orders to move them to a new price.
                  If you are using an Atm with trailing, this will undo any changes you make.

                  No, this could not be in the same OIF file as the orders have to exist and have an order id before you can change them.
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  553 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  324 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  100 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  543 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  546 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X