Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Manual ATM Strategy vs. NinjaScript ATM Calls

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

    Manual ATM Strategy vs. NinjaScript ATM Calls

    I have created an AutoTrade Script file based on your example. It requires that Order IDs and ATMStrategy IDs be 0 length before an order is entered. It seems, however, that if I manually enter a trade to an ATM Strategy, the two IDs are always returned as 32 and 38 char lengths and do not zero out when closed and the position goes flat. Stopping the running Script and re-attaching the Script strategy zeros the two IDs.

    If the script places the order, the IDs reset to 0 length.

    Is there something else I should know or review.

    This

    Print(Time[0] + ", " + Instrument.FullName + ", " + orderId.Length + ", " + atmStrategyId.Length + ...

    returns

    1/7/2009 12:29:17 PM, TF 03-09, 32, 38 ...

    even when the position is flat

    #2
    snaphook,

    NinjaScript strategies should only be used with ATM strategies it invokes itself. It is not intended to interface with things you have done manually for an entry.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I'll play around with it to see what happens when human intervention occurs.

      If I have a script strategy ("abc") attached to TF 03-09 and I manually enter a trade on a different signal, or on a whim whichever fits; if I left click the close button on the price ladder, the position is closed but the chart script strategy is stopped on the chart and I must reattach it. If I middle click the Close button, the position is closed, but the chart script remains attached. Is this the way it is supposed to work?

      Also, if the script triggers and calls an ATM Strategy and I manually cancel it, will the Order and ATMStrategy IDs be cleared or will the script kinda lose its place and the IDs never reset to 0 length?

      I'm trying to get a handle on what can and can not be done when running from a chart based Ninja Strategy.

      Thanks,
      Snap

      Comment


        #4
        Snap,

        Yes, that is how it works. The close button closes ALL positions, automated or manual, unless you middle mouse click it.

        If the script triggers an ATM strategy you should be able to monitor it and reset it to 0 yourself when such a condition occurs.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          OK. The Close button tool tip is very misleading.

          "Closes a position (left click) or strategy (middle click)"

          but in fact, left click closes all positions and all strategies and middle click just closes the current strategy position.

          Comment


            #6
            Right. That is correct. Left click closes the position, middle click closes the selected strategy. http://www.ninjatrader-support.com/H...nButtons3.html
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              When I have tried it, a left click, in addition to closing the current ATMStrategy position and canceling any working orders, also stops any working script strategies attached to the instrument chart. This means that, to close an ATMStrategy position called from script, a left click on Close will close your position andyour working script strategy forcing you to reload it, whereas a middle click will close your position in the working ATMStrategy but leave your working script strategy alone.

              Comment


                #8
                That is correct. That is the behavior you should see.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by rtwave, 04-12-2024, 09:30 AM
                2 responses
                20 views
                0 likes
                Last Post rtwave
                by rtwave
                 
                Started by tsantospinto, 04-12-2024, 07:04 PM
                5 responses
                67 views
                0 likes
                Last Post tsantospinto  
                Started by cre8able, Today, 03:20 PM
                0 responses
                6 views
                0 likes
                Last Post cre8able  
                Started by Fran888, 02-16-2024, 10:48 AM
                3 responses
                49 views
                0 likes
                Last Post Sam2515
                by Sam2515
                 
                Started by martin70, 03-24-2023, 04:58 AM
                15 responses
                115 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X