Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

FlattenEverything from code...negates race condition

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

    #16
    Josh

    I misled you somewhat...

    I am not writing to file from OIF Builder....did not understand the use of that...thought maybe that affected the text

    I am writing to file from code using StreamWriter....

    1. after starting NT....connect either zenfire or MR....load and enable strategy....on condition it writes to incoming folder, executes oif per Log, deletes oif.txt from incoming folder....works perfectly and instantly

    2. now that acct is flattened, I try to enable the same strategy, it enables however on condition this time it writes the oif.txt to incoming folder however does not execute it...it just stays in the folder.....this leaves many positions and orders active.....

    I found the only time it works properly is once only after restart NT
    Last edited by ATI user; 12-15-2009, 02:51 PM.

    Comment


      #17
      Can you please provide a simple as possible reference script demonstrating this? Thank you.
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        ATI_user,

        I tried multiple times with your file and each time the OIF file is written, the position is closed and strategy is stopped as expected. Please be absolutely sure you have ATI enabled.
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          Yes it is enabled...or it would not work the first time

          and it is still enabled when it does not work the second, third, etc

          all I did between the two attached pics was enable the strat

          ...... edit

          did you run on beta 5 code?
          Attached Files
          Last edited by ATI user; 12-16-2009, 04:04 PM.

          Comment


            #20
            I am unable to reproduce. Please see attached logs. Every time there is one of your custom log messages about written file, it is closely followed by an ATI process log entry.

            12/16/2009 2:02:01 PM|1|1|AT, 'FLATTENEVERYTHING;;;;;;;;;;;;' processing

            Suggest you try reinstalling your NinjaTrader.
            Attached Files
            Josh P.NinjaTrader Customer Service

            Comment


              #21
              Originally posted by NinjaTrader_Josh View Post
              I am unable to reproduce. Please see attached logs. Every time there is one of your custom log messages about written file, it is closely followed by an ATI process log entry.

              12/16/2009 2:02:01 PM|1|1|AT, 'FLATTENEVERYTHING;;;;;;;;;;;;' processing

              Suggest you try reinstalling your NinjaTrader.
              are you running the same exact NT 7 beta 5 code that I have?

              Comment


                #22
                As I am working remotely at this point in time I only have latest sources available, but there has not been anything changed in regards to ATI interface that I am aware of. If you wish you could wait till the next beta and try again too.
                Josh P.NinjaTrader Customer Service

                Comment


                  #23
                  Originally posted by NinjaTrader_Josh View Post
                  As I am working remotely at this point in time I only have latest sources available, but there has not been anything changed in regards to ATI interface that I am aware of. If you wish you could wait till the next beta and try again too.
                  there may not have been ATI changes, however your new code clearly solves the issue...

                  one of my users just did the same test.....same result

                  bug is in beta 5.....glad it is fixed already

                  Comment


                    #24
                    oif

                    ati user

                    You might want to write your files using a file name other than anything similar - I see you are using oif3.txt - see if the problem persists if you use say oif4.txt??

                    But if it is solved in next Beta then maybe that is not an answer?

                    Glad you got it sorted.

                    Comment


                      #25
                      bummer Josh

                      beta 6 still does same thing

                      i.e. oif works once after starting NT....but not again....first time perfect, after that is just writes the oif3.txt file to 'ninjatrader/incoming' folder and does not execute it

                      do not know how last time you could not reproduce this problem...I am using same cs I sent to you and it will not work more than once after restart

                      Comment


                        #26
                        even bigger bummer

                        has nothing to do with code...it is a setting

                        must have 'ignore duplicte oif files' unchecked per attached pic

                        did not read anything anywhere about that so assume it meant if you were submitting two or more oifs at the same time....not during the same session

                        works as expected with the proper setting

                        Questions:
                        1. is it possible to check ATI and Duplicate OIF file settings from code?

                        2. is it possible to change ATI and Duplicate OIF file settings from code?
                        Attached Files

                        Comment


                          #27
                          Checking or changing those options is not supported.

                          When tested on my end with your exact script, Ignore duplicate OIF was not checked on my end. If you could reattach your strategy here I will have a colleague check on his end tomorrow morning. Please be advised that there has been no change in OIF handling from 6.5 to 7 that I am aware of. Be sure you actually have a position to exit for your FlattenEverything call before the OIF is generated.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #28
                            works fine now ...per my post above

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            612 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            355 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            105 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            561 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            564 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X