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

Is it possible to have finer control over an order submitted via AtmStrategyCreate()?

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

    #16
    ChelseaB - that is not the result I got from some tests I did and I welcome you to see for yourself by using the sampleAtmStrategy you created on two charts with slightly different intervals (so that there is overlap between their order placement and cancellation) and using the same account and instrument. In this scenario, I found AtmStrategyClose() executed on the strategy of one chart affected the orders of the strategy on the other chart.

    Comment


      #17
      Originally posted by mbesha View Post
      ChelseaB - that is not the result I got from some tests I did and I welcome you to see for yourself by using the sampleAtmStrategy you created on two charts with slightly different intervals (so that there is overlap between their order placement and cancellation) and using the same account and instrument. In this scenario, I found AtmStrategyClose() executed on the strategy of one chart affected the orders of the strategy on the other chart.
      mbesha, are you using the same ATM strategy template name inside both instances of sampleAtmStrategy strategy?
      Last edited by bltdavid; 01-30-2020, 10:52 PM.

      Comment


        #18
        Originally posted by NinjaTrader_ChelseaB View Post
        Hello mbesha,

        The AtmStrategyClose() will close a strategy by ID. This is ID is generated by GetAtmStrategyUniqueId(). This ID will be unique each time its called. For each chart running the script, a different ID is going to be used so the NinjaScript Strategy will only be closing the Atm Strategy created with that ID.
        Hmm, but wait ... your video implied that the ATM strategy template name used for the manual position
        must be different than the ATM strategy template name supplied to AtmStrategyCreate in the NinjaScript.
        Yes, I just reviewed your video again -- you have created two different ATM strategy templates -- one you
        used inside the NinjaScript strategy and the other you used for your manual trades -- it seems like
        it was very important to have two separate ATM strategy templates -- is that takeaway correct?

        But your comment above seems to imply the ATM strategy template name doesn't matter, it is the
        uniqueness of the string returned by GetAtmStrategyUniqueId() that keeps everything working properly.

        Is that right? I feel like there is a disconnect here.

        I think the missing piece for me is 1) the ATM strategy template name used with AtmStrategyCreate must
        be different than the ATM strategy template name employed for manual trading, and 2) each NinjaScript
        strategy calling AtmStrategyCreate must use a different ATM strategy template name.

        Is #2 necessary?
        Chelsea, your video does not address #2.

        What I mean is,
        What if two instances of the @SampleAtmStrategy strategy -- sure, both call GetAtmStrategyUniqueId but
        they also both use the same ATM strategy template name in AtmStrategyCreate -- what happens when two
        instances of this same strategy using the same ATM template execute simultaneously but on different
        charts?

        mbesha, is that what you're doing?

        [Beg pardon that I am refereeing this thread so much, but I am keenly interested in this issue as well.]
        Last edited by bltdavid; 01-30-2020, 10:54 PM.

        Comment


          #19
          Originally posted by bltdavid View Post

          mbesha, are you using the same ATM strategy template name inside both instances of sampleAtmStrategy strategy?
          Yes , that's correct.

          ​​​​

          Comment


            #20
            Originally posted by bltdavid View Post



            What I mean is,
            What if two instances of the @SampleAtmStrategy strategy -- sure, both call GetAtmStrategyUniqueId but
            they also both use the same ATM strategy template name in AtmStrategyCreate -- what happens when two
            instances of this same strategy using the same ATM template execute simultaneously but on different
            charts?

            mbesha, is that what you're doing?
            Yes, that what I'm doing and thank you for your input.

            Comment


              #21
              Hello mbesha,

              I am not able to reproduce this behavior.

              Below is a link to a video that shows two instances of the strategy running on different intervals without using charts, and when the two instances are running on different charts. The behavior is always the same. AtmStrategyClose() will only close the strategy that has the id provided and each strategy is generating a new id.



              Please send an email to platformsupport [at] ninjatrader [dot] com so that I may perform this exact same test on your end to ensure the behavior is the same.

              Chelsea B.NinjaTrader Customer Service

              Comment


                #22
                Originally posted by NinjaTrader_ChelseaB View Post
                Below is a link to a video ...
                Thanks, Chelsea!

                Comment


                  #23
                  Originally posted by NinjaTrader_ChelseaB View Post
                  ... so that I may perform this exact same test on your end to ensure the behavior is the same.
                  Any updates on the resolution of this issue?

                  Comment


                    #24
                    Hello bltdavid,

                    There has not been resolution at this time.

                    Are you also having an issue? If you perform the same test I've shown in the video are you experiencing different behavior?


                    mbesha,

                    I have not seen any emails in our platform support ticketing system with a link to this forum thread.
                    May I confirm that you have sent an email to platformsupport [at] ninjatrader [dot] com?
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #25
                      Nope, no issues here -- I'm ok -- years ago, as a wee lad (aka novice NinjaScript programmer), I thought
                      I had some issues, but never pursued the problem. I wanted to move to Unmanaged anyways, so now I
                      have a gap in my knowledge of using Atm Strategies in NinjaScript. This thread reminded me of that gap
                      and I became interested.

                      Anyways, your excellent videos showed some simple test cases that have convinced me everything should
                      work as I expect.

                      I had some suspicions that maybe mbesha was following in my tracks, but I don't remember what my own
                      tracks were at the time .

                      I'm hoping mbesha keeps in touch and updates this thread with the resolution to his problem.

                      Comment


                        #26
                        - Thanks for the time and effort in making the video and it does seem that there is no cross-over effect from the test you conducted. I got a similar result when I did some testing on my end as well. I guess that settles it for AtmStrategyClose().
                        @bitdavid - thanks for your input.

                        Comment


                          #27
                          Hi mbesha,

                          Glad, you got it working, mate!

                          Was your code doing anything wrong?

                          I mean, did you have to make code changes to eliminate the initial problem you saw?

                          It could help others to elaborate on how to avoid the same issue ...

                          Thanks!

                          Comment


                            #28
                            Hi bitdavid

                            I haven't gotten to the bottom of the unexpected behavior and may not get around to doing so as I have already made the switch to a managed approach as I previously mentioned I would be doing. If others do come across any issues, they'd have to pick it up from where I've left off unfortunately.
                            ​​​

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by jclose, Today, 09:37 PM
                            0 responses
                            4 views
                            0 likes
                            Last Post jclose
                            by jclose
                             
                            Started by WeyldFalcon, 08-07-2020, 06:13 AM
                            10 responses
                            1,413 views
                            0 likes
                            Last Post Traderontheroad  
                            Started by firefoxforum12, Today, 08:53 PM
                            0 responses
                            10 views
                            0 likes
                            Last Post firefoxforum12  
                            Started by stafe, Today, 08:34 PM
                            0 responses
                            10 views
                            0 likes
                            Last Post stafe
                            by stafe
                             
                            Started by sastrades, 01-31-2024, 10:19 PM
                            11 responses
                            169 views
                            0 likes
                            Last Post NinjaTrader_Manfred  
                            Working...
                            X