Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

converting indicator to strategy

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

    #16
    converting indicator to strategy

    I cannot seem to set DefaultQuantity. (version 6.5) When i set it in the GUI the corresponding ATM template only shows a value of 1 contract.
    I am using
    atmStrategyId = GetAtmStrategyUniqueId();
    orderId = GetAtmStrategyUniqueId();
    if (type == LONG)
    AtmStrategyCreate(Cbi.Action.Buy, OrderType.Market, 0, 0, TimeInForce.Day, orderId, atmStrategyName, atmStrategyId);
    else
    AtmStrategyCreate(Cbi.Action.Sell, OrderType.Market, 0, 0, TimeInForce.Day, orderId, atmStrategyName, atmStrategyId);

    preceding the above with
    DefaultQuantity = 3;
    also does not work.
    Nor did DefaultQuantity = 3 in Initialize();
    The value Prints correctly but is not being communicated to the ATM template
    Last edited by roland_nt; 11-08-2010, 10:58 PM.

    Comment


      #17
      Roland, you would not be able to set this for the ATM template, it would take the qty saved in your template, so for different qty's > please create and call different ATM templates.

      Comment


        #18
        converting indicator to strategy

        Somehow I missed this in the documentation. It would have been helpful if this point was made in the write ups for AtmStrategyCreate(). and DefaultQuantity
        Also it doesn't seem seem to be possible to change the "Order qty" field in the DOM and have the new value used on the next trade. It appears that you have to first save the template with the new value and reload it. Am I missing something about that requirement?

        Comment


          #19
          Roland, yes for calling the ATM's via NinjaScript, please have a range of templates available so you can work with different qty's. If you just change the value on the DOM, it would not be automatically saved to the template that is called.

          Comment


            #20
            converting indicator to strategy

            Two more questions:
            1) Occasionally the strategy starts the DOM but the target and stop are missing in the price columns. I have tried combinations "ATM strategy selection method" in the ATM properies, but this seems to get things even more confused. What am I likely doing wrong that would cause the DOM to be started with a position but no stop and target in place ? (They are properly set in the saved ATM template)
            2) Ideally the indicator would like to open up 2 different DOMs with different entries, stops and target although same instrument. Is this feasible?

            Comment


              #21
              Hello roland_nt,

              Not sure why you're seeing stop loss and trargets not submitted. Best is to use print statements and then can check the output to verify all segments get executed properly. If you can isolate this to reproducible steps, please let us know.

              Yes, you can call multiple ATM strategies from one NinjaScript strategy.
              Ryan M.NinjaTrader Customer Service

              Comment


                #22
                converting indicator to strategy

                Oops repeating inadvertent out of order post--
                Two more questions:
                1) Occasionally the strategy starts the DOM but the target and stop are missing in the price columns. I have tried combinations "ATM strategy selection method" in the ATM properies, but this seems to get things even more confused. What am I likely doing wrong that would cause the DOM to be started with a position but no stop and target in place ? (They are properly set in the saved ATM template)
                2) Ideally the indicator would like to open up 2 different DOMs with different entries, stops and target although same instrument. Is this feasible?

                Comment


                  #23
                  The DOM window would need to be opend by you directly - codewise this would not be supported.



                  The default 'Select Active ATM on order submission' should be fine to display the active working ATM with its orders on the DOM.

                  Comment


                    #24
                    converting indicator to strategy - ATM strategy select

                    Bertrand, I'm still uncertain and having anomalous template behavior for which a cannot figure out how to reproduce (for NT 6.5). As always thanks for all your help, so far.

                    Here are two scenarios I desire. Please indicate which scenario, if any, is possible and what the "ATM strategy selection mode" should be for each template in each scenario.

                    Scenario 1) Two DOM windows. One DOM window in which a trade is started and completed by the NinjaScript strategy a few times during the trading session using "AtmStrategyCreate".along with ATM template "A". A second DOM, using ATM template "B", in which I may manually start a different trade, same instrument, (by either hitting market order or setting in a limit) at any moment which moment might be fully included within or overlapping the interval during which the first DOM is actively handling a trade. Each DOM has separately named/saved ATM strategy names and references same instrument.

                    Scenario 2) Two DOM windows, one having a trade started by the NinjaScript strategy using AtmStrategyCreate and ATM template "A" and a second DOM window, using AtmStrategyCreate and ATM template "B", with a trade started later but otherwise concurrently with the first trade, both trades referencing same instrument

                    3) In either scenario, do both DOM windows need to be opened and visible before any trades are taken or will ATMStrategygyCreate open a DOM as necessary?

                    Comment


                      #25
                      Roland, for both scenarios the DOM does not have to open nor any AtmStrategyTemplates manually selected for the NinjaScript calling those to be working and executing orders using them. You do want to have a DOM open if you would like to visualize those orders and trades. The visualization done will depend on the strategy selection mode you're running - the default mode should server you fine for what you like to do.

                      Comment


                        #26
                        converting indicator to strategy - reversing

                        This indicator likes to reverse at target, but not all of the time. Which is the way to handle reversing but leave the flexibility to ocassionaly not take the reverse?
                        1) scenario 1. if the selected ATM strategy has been saved with the advance option "Reverse at target" checked, can I turn hat on and off that option from within NinjaScript after the ATM strategy has been fired off (but before the trade has finished
                        2) Scenario 2. Enter the first trade at market using ATM staretgy that does not have "reverse at target" .When filled, start a new order id with a limit entry at the target of the originating trade, i.e, explicitly manage the revers with NinjaScript.

                        Another question: If I initiate an ATM strategy which has ."reverse at target", how do I find out the order id of the reverse position in order to adjust its target

                        Comment


                          #27
                          Option #2 is the route you would want to take.

                          The reversal would still have the same strategyId I believe which would still allow you to use GetAtmStrategyStopTargetOrderStatus() to get the information you need
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #28
                            converting indicator to strategy - reversing

                            So that means that there is no way to control the value of "reverse at target" while the order is in process, not even a "back door " method?
                            The problem is that general y I want trade number 1 to reverse at target but not trade #3 (the one after the reverse and now in the same direction as trade #1.

                            I may want trade number 3 to reverse depending on how trade 2 behaves.

                            So the sequence would be
                            1 log reverses to 2 short and then maybe 3 long should reverse or wait depending on how 2 behaved.

                            Comment


                              #29
                              Right. Unfortunately not.
                              Josh P.NinjaTrader Customer Service

                              Comment


                                #30
                                converting indicator to strategy - reversing

                                I seem to be also having some uncertainty about "advanced options"
                                It seems that even though the options were saved, when started from NinjaScript, they are not in effect unless i right click the active DOM and turn them on.
                                Am I correct or is this ****pit error

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                649 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                370 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                109 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                573 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                576 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X