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 Order Instruction File how to couple with an existing trade management strategy

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

    OIF Order Instruction File how to couple with an existing trade management strategy

    I have been using OIF for sometime with an ATM but I would rather use a trade management strategy in tandem with OIF. So I have Tradingview sending the order to PLACE- Buy or Place -Sell and it has some closing exits but unfortunately ClosePosition closes every thing for that account, so if I create individual targets it wont do me any good because it will close the whole position. Is it possible to tie the order to an existing strategy in NT? in OIF it shows
    STRATEGY Strategy template name (must exist in NinjaTrader)
    So just checking to see if I call a trade management strategy that I have created in NT then it will take over and be the primary strategy working with the ATM to manage the trade. Any examples of this to point to?

    #2
    Hi set2win, thanks for posting. The only way a strategy can manage an order that it did not generate is to create an Addon style Account object and monitor/manage the order from that object. This will not include any of the managed approach features, so the script does not need to be a strategy, it can be an indicator.

    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      So what is the purpose of Strategy mentioned in the OIF explanation?

      Comment


        #4
        Originally posted by set2win View Post
        So what is the purpose of Strategy mentioned in the OIF explanation?
        It refers to an ATM strategy, usually the name of an ATM strategy template.

        Comment


          #5
          Yes that's right, I forgot I am already using the ATM strategy template. Any plans in future updates to expand the OIF to include more options? so an Add on to monitor let say stoploss or account balance limit to close a trade? I'l have to look in ecosystem to see if anyone has devised this.

          Comment


            #6
            Hi, thanks for your reply.

            There are no open changes for the IOF system at this time.

            Please let me know if I can assist any further.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by set2win View Post
              Yes that's right, I forgot I am already using the ATM strategy template. Any plans in future updates to expand the OIF to include more options? so an Add on to monitor let say stoploss or account balance limit to close a trade? I'l have to look in ecosystem to see if anyone has devised this.
              Strictly speaking, you don't need an Addon to do that.

              Like Chris said, you could use the Account as the entry
              point to the methods to manage the trade, and that
              could be done inside an Indicator or an AddOn.

              Btw, have you seen these files?

              Comment


                #8
                bltdavid, Thanks, I'm not getting what you are saying. Maybe I should explain how I'm using the OIF. I create strategies on Tradingview, which sends a webhook to python flask app that deposits the Place order into Incoming. I use an NT 3 target ATM strategy and the Tradingview strategy can close the trade also, based on conditions. I understand the information files show "Filled", the entry price and quantity. What I don't understand is how to use the Account. Do you have any files that do this that you can share?

                Comment


                  #9
                  No, sorry, I don't.

                  One suggestion would be: drop those OIF files into a different folder, call it
                  'incoming2' and you write a NinjaScript strategy that monitors that folder,
                  reads those files, enters the appropriate orders, and then performs the
                  trade management.

                  But the best part:
                  You can invent 'new' OIF style commands that TradingView would create,
                  say, when it knows to exit the trade. When TradingView wants to close
                  the trade, it creates your special OIF file, and your python flask app drops
                  that file into incoming2. Because your strategy is continually monitoring
                  that incoming2 folder, your strategy can immediately know to close the
                  position.

                  This is all quite do-able and relatively straightforward coding in C# using
                  a standard NinjaScript 'Strategy' plugin.

                  Hint,:
                  To watch for files in the 'incoming2' folder, use FileSystemWatcher.

                  Comment


                    #10
                    Thanks again, bltdavid, those are some great ideas , I will have to learn a new trick here but you have pointed me in the right direction.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by ghoul, Today, 06:02 PM
                    2 responses
                    12 views
                    0 likes
                    Last Post ghoul
                    by ghoul
                     
                    Started by jeronymite, 04-12-2024, 04:26 PM
                    3 responses
                    44 views
                    0 likes
                    Last Post jeronymite  
                    Started by Barry Milan, Yesterday, 10:35 PM
                    7 responses
                    20 views
                    0 likes
                    Last Post NinjaTrader_Manfred  
                    Started by AttiM, 02-14-2024, 05:20 PM
                    10 responses
                    180 views
                    0 likes
                    Last Post jeronymite  
                    Started by DanielSanMartin, Yesterday, 02:37 PM
                    2 responses
                    13 views
                    0 likes
                    Last Post DanielSanMartin  
                    Working...
                    X