• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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, 09: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, 09: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.

              https://drive.google.com/file/d/11sq...w?usp=drivesdk

              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 tonynt, Today, 04:19 AM
                            0 responses
                            1 view
                            0 likes
                            Last Post tonynt
                            by tonynt
                             
                            Started by ralett, Yesterday, 07:29 PM
                            1 response
                            7 views
                            0 likes
                            Last Post NinjaTrader_Marco  
                            Started by bboyle1234, Yesterday, 10:46 PM
                            1 response
                            7 views
                            0 likes
                            Last Post bltdavid  
                            Started by swcooke, Yesterday, 04:29 PM
                            0 responses
                            5 views
                            0 likes
                            Last Post swcooke
                            by swcooke
                             
                            Started by bboyle1234, Yesterday, 04:27 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post bboyle1234  
                            Working...
                            X