Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

oif file does not work

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

    oif file does not work

    Hello,

    Im trying to generate an oif.txt file but when I put it in the incoming folder, NinjaTrader does not place the order.
    Do you know what is the problem?
    I attach you the file that Im using.

    Im using the trial account and I dont know if it can be the problem.

    Thanks.
    Attached Files
    Last edited by Javi26; 02-25-2020, 07:49 AM.

    #2
    Hello Javi26,

    Thanks for your post.

    Please ensure that the AT Interface is enabled in the Control Center's Tools > Options > Automated Trading Interface menu. Please then restart the platform and connect to your data provider. Afterwards, please copy the OIF file attached into the incoming folder.

    I have also attached an OIF file that includes 0's for Limit and Stop price for a Market Order.

    If you are still having issues, please check the Log tab of the Control Center and copy any errors you see related to OIF files. You can click on an error and press Ctrl + C to copy the error.

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello, thanks for your answer.

      After enabling AT interface it works if I copy paste de oif.txt file. But when I write the file directly in the incoming folder using Python, it occurs an error saying that another program is using it. I have shared the incoming folder with another server where I write the txt file. I close the file too after writing it.
      Maybe NinjaTrader8 is too fast reading the file?
      Do you know how can I solve this issue?

      Thanks.
      Last edited by Javi26; 02-26-2020, 04:41 AM.

      Comment


        #4
        Hello Javi26,

        Thanks for your post.

        I've been able to reproduce and I would not expect the file access violations on my set up.

        We are investigating further and we will keep you posted on our findings.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hello,

          Another problem that I have is concerning limitPrice and stopPrice. When I do a buy action with MARKET value for example 3090,5 if I put limitPrice=3098 and stopPrice=3087,5 the bet is not closed when it reaches this values. Do you know what is happening?

          Thank you.

          Comment


            #6
            Hello Javi26,

            Thanks for your patience.

            I have reproduced the issue copying and pasting the file. Windows has not yet let go of the file when it is being processed by NinjaTrader. Development has recommended to move the file as this is uninterruptible from the Operating Systems perspective. I may suggest an approach to write the files in a "buffer" location, and then to move the OIF files to the "incoming" folder after that.

            As for market orders, these should have 0 entered for Limit and Stop prices. These prices should only be used for Limit, Stop Market, and Stop Limit orders. If the order type does not use one of these prices, it should not be used.

            If you have an example of an OIF file for a Limit order or Stop Market order that is not respecting the Limit or Stop Price, please include an attachment. (Please ensure the other price is set to 0 if not used.)

            We look forward to assisting.
            JimNinjaTrader Customer Service

            Comment


              #7
              I am following the process outlined above to copy and past the OIF into the "incoming" directory from a buffer folder, however the folder becomes in use and cannot process. The Log file shows the following error when I paste into the folder or delete the file. Do you have any guidance for fixing this?

              Comment


                #8
                Welcome to the forums c01101!

                Copy and pasting interferes with submitting OIF's since the file is not yet let go from Windows when the file gets read in the platform with .NET framework.

                If moving the files is not working for you, we would suggest writing in the folder directly from a script or application.

                I have attached an example AddOn that uses a StreamReader and a StreamWriter to copy OIF files from a Documents\NinjaTrader 8\OIF Source\ folder to the incoming folder. This is adequate for testing OIF's and shows that writing into the incoming folder with a StreamWriter works.

                You can import this script and open the OIFSubmitter Window in the Control Center under New. The Submit Next OIF button will read the next OIF file in Documents\NinjaTrader 8\OIF Source\ and create a new file in the Documents\NinjaTrader 8\incoming folder.

                We look forward to assisting.
                Attached Files
                Last edited by NinjaTrader_Jim; 12-28-2020, 11:56 AM.
                JimNinjaTrader Customer Service

                Comment


                  #9
                  Many thanks Jim. I tried writing directly to the directory and that works as long as each file is named something different, ie oif1, oif2 etc.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by southpacific001, 02-26-2021, 09:25 PM
                  13 responses
                  61 views
                  0 likes
                  Last Post southpacific001  
                  Started by punkiy2111, Today, 05:22 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post punkiy2111  
                  Started by secrettrader, Today, 03:36 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post secrettrader  
                  Started by t3chn0, Today, 01:03 PM
                  1 response
                  11 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Started by jleira, Today, 02:27 PM
                  0 responses
                  25 views
                  0 likes
                  Last Post jleira
                  by jleira
                   
                  Working...
                  X