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

Strategies Tab - Stopping cs/atm

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

    Strategies Tab - Stopping cs/atm

    I have a cs placing trades and trailing stops. I would like to be able to exit its trades by clicking Stop for that trade in the Strategies Tab (instead of clicking Close in chart trader which removes my cs from the chart). However, when I stop the ATM strategy initiated by my cs, by clicking Stop for that trade in the Strategies Tab, my cs still thinks the ATM strategy is running and therefore does not update its info correctly....meaning it can not place new trades etc as it thinks it is still in a trade.

    Please advise if there is a way for my cs to pickup the exit condition. GetAtmStrategyEntryOrderStatus() does not pickup the closed position.

    I also note that when clicking on Stop in the Strategies Tab it does not calculate Realized Gain at all for the stopped ATM...even though the Executions Tab reflects the exit price and time correctly. I assume this is an oversight and that the Realized PnL should be updated in the Strategies Tab.

    #2
    All works as expected. When you terminate the ATM it does just that, terminate itself and it likely remains in its current state.

    What you need to do is close an ATM strategy by clicking on the CLOSE button in Chart Trader...however, there is a special approach to this..More information on that here.



    This approach will allow your approach to work.
    RayNinjaTrader Customer Service

    Comment


      #3
      thanks Ray

      yes that allows me to close the trade without having the cs removed from the chart...which is helpful

      however, my cs still does not pickup the fact that the ATM strategy has been exited and therefore does not know that the cs strategy has been exited. How do I achieve that? This is most important since, if I can not achieve that, I might as well have the cs removed from the chart and reload/restart it. This is not good as I lose all the data I need to manage my trading for the entire session.

      also...I still believe the strategies tab should reflect the pnl on the closed trade..perhaps a wish list item for NT 7.0?

      Comment


        #4
        Have you checked the SampleATMStrategy that installs with NT? If my memory serves me correctly, that demonstrates to check if the ATM is closed.
        RayNinjaTrader Customer Service

        Comment


          #5
          yes I have...I use the same code in my cs to check active status....ie GetAtmStrategyMarketPosition as shown in attachment from NT's sample strategy

          this does not pickup a strategy status is closed as discussed.

          some weeks ago I asked about having the ability to check an account to see if any trades were open....this in order to check from a cs if a manual trade was open the in account before entering a cs trade....he said this would be available in NT 7. Would this same feature solve my current question/problem?
          Attached Files

          Comment


            #6
            If you run a test on the SampleATMStrategy, does it work as expected?
            RayNinjaTrader Customer Service

            Comment


              #7
              no...it does not run as I would expect

              Atm strategy selection mode = SelectActiveAtmStrategyOnOrderSubmission

              I closed the trade with the scroll wheel clicking the Close button in Charttrader and got the following results...see attachments

              The cs stays in the chart - expected

              Executions Tab shows a buy and a sell and flat position - expected

              Accounts Tab shows a realized profit of 40.64 - expected

              Strategies Tab shows position as 1L and realized profit as 0 - not expected...it should show flat position and 40.64 profit

              Output Window shows still in a position with a dynamic unrealized profit - not expected...it should show flat so the strategy can enter another trade

              this is a bug and my point exactly...my strategy (using the same code) still thinks it is in a trade also...rendering it useless until I remove my cs from the chart and start over...which is no good
              Attached Files

              Comment


                #8
                so Ray...bug? or no bug?

                if no bug, will this be improved?....I really need to be able to test that the trade is closed without disturbing my cs

                thanks

                Comment


                  #9
                  Sorry,

                  I missed this somehow.

                  I took a look at one image and I saw you are testing in Market Replay. Can you run a test on any other real-time connection in the Sim101 account? Same issue?
                  RayNinjaTrader Customer Service

                  Comment


                    #10
                    no worries

                    ok...learned something there...in real time, I note that if you do not have an active strategy showing in the dropdown window in Charttrader, then NT asks you to select a strategy to close

                    Once you select an active strategy and click on Close, using the scroll wheel, it works properly..i.e. it closes it and shows the correct PnL in the Strategies window and the cs picks up the flat position...cool...just what I needed

                    I do not know if this is a factor or not, however in Charttrader I have atm selection strategy set to 'KeepSelectedAtmStrategyTemplateOnOrderSubmission' ...please confirm....although that is the only setting I use anyway

                    thanks
                    Last edited by ATI user; 08-18-2008, 12:54 PM.

                    Comment


                      #11
                      Yes, that would make a difference.
                      RayNinjaTrader Customer Service

                      Comment


                        #12
                        this works great and now brings up a further need for being able to sort the Strategies Tab grid by Time (which I am told is being added in a coming version)

                        also, would it be possible for you to add the Strategies Tab the number of the ATM (the number used in ChartTrader etc)???

                        why?...I have 3 charts all automatically generating trades and I need to be able to differentiate between the trades in order to close the right one...hard to do if I lose track of which trade initiated in which order....especially without Time in the Strategies grid....

                        actually... if you put Time in the Stratagies grid then I will not need the AtmTemplate number will I...as I will now the order based on the time

                        thanks

                        Comment


                          #13
                          I will add these as requests for futher consideration. Thanks.
                          RayNinjaTrader Customer Service

                          Comment


                            #14
                            thanks...time is the main one

                            I just ran a test using Market Replay and the Close/Scroll Wheel exit does not work...as we already knew....glad it works in real time

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by GussJ, 03-04-2020, 03:11 PM
                            16 responses
                            3,281 views
                            0 likes
                            Last Post Leafcutter  
                            Started by WHICKED, Today, 12:45 PM
                            2 responses
                            19 views
                            0 likes
                            Last Post WHICKED
                            by WHICKED
                             
                            Started by Tim-c, Today, 02:10 PM
                            1 response
                            9 views
                            0 likes
                            Last Post NinjaTrader_ChelseaB  
                            Started by Taddypole, Today, 02:47 PM
                            0 responses
                            5 views
                            0 likes
                            Last Post Taddypole  
                            Started by chbruno, 04-24-2024, 04:10 PM
                            4 responses
                            53 views
                            0 likes
                            Last Post chbruno
                            by chbruno
                             
                            Working...
                            X