Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Faster order entry on Chart Trader. Click Trader?

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

    #16
    Hello,

    NinjaTrader is designed to only show active/working orders on the order entry windows, so since the stop and target order of an ATM are not yet live orders, these orders are excluded from the display. Once they are submitted to your broker, the orders appear and can be managed. The only alternative would be to manually place the stop and target order as an OCO pair, but this runs the risk of one of these orders filling before your entry order fills.

    Please let me know if I may assist further.
    Ryan S.NinjaTrader Customer Service

    Comment


      #17
      Originally posted by NinjaTrader_RyanS View Post
      NinjaTrader is designed to only show active/working orders on the order entry windows, so since the stop and target order of an ATM are not yet live orders, these orders are excluded from the display.
      Exactly! this is what I mean, that even such essential basic functions are simply missing. Sad but true

      Comment


        #18
        Greetings.

        Just an FYI for developers.

        I downloaded this TEST ONLY Development SAMPLE posted by an NT staff member in another thread. For Developers this is one nice step forward, but only a start on what you will need.

        1) Attach as an indicator.
        2) Right Click anywhere on the chart to pull on the long menu that would let you select Limit and Stop orders.
        3) Escape out of that menu and presto.. Very quickly you have added two orders to your screen that now need to be better positioned.

        Trust me .. (I only saw surprises while still in Sim mode) This is not ready for production use as is.. way to easy to forget it is attached and you might be dropping order where you don't want and frequently..

        A first next step might be to add on-screen buttons that drive bools to enable the indicator and for what type of order next.

        HedgePlay
        Attached Files

        Comment


          #19
          Developers might find an nice solution by combining that starter sample indicator with this pretty well developed (but 0nly long not yet for short) starter sample ..

          Here is the link to a current discussion around the attached sample below, But the context is completely different so discussion should stay in this thread. https://ninjatrader.com/support/foru...ns#post1127279
          Attached Files
          Last edited by hedgeplay; 11-12-2020, 12:09 PM.

          Comment


            #20
            Originally posted by hedgeplay View Post
            Greetings.

            Just an FYI for developers.

            I downloaded this TEST ONLY Development SAMPLE posted by an NT staff member in another thread. For Developers this is one nice step forward, but only a start on what you will need.

            1) Attach as an indicator.
            2) Right Click anywhere on the chart to pull on the long menu that would let you select Limit and Stop orders.
            3) Escape out of that menu and presto.. Very quickly you have added two orders to your screen that now need to be better positioned.

            Trust me .. (I only saw surprises while still in Sim mode) This is not ready for production use as is.. way to easy to forget it is attached and you might be dropping order where you don't want and frequently..

            A first next step might be to add on-screen buttons that drive bools to enable the indicator and for what type of order next.

            HedgePlay
            Hello hedgeplay and NT support,

            thank you for the great sample. I made some changes in the script so now you can only enter limit order if you simultaneously press left shift and left mouse click.

            Only two problems remain to be solved:

            1) how to avoid an error when clicking the chart with the mouse without pressing the left shift key (see error in a Log:
            Failed to submit orders: System.NullReferenceException: Object reference not set to an instance of an object. at NinjaTrader.Cbi.Account.Submit(IEnumerable`1 orders);
            2) So far only a simple limit order can be placed, but I would like to place a limit input of an "ATM" Strategy (with predefined SL and PT in chart trader).

            Would anyone know how to do that?

            Thank you,
            emuns
            Attached Files

            Comment


              #21
              Hello,

              I have figured out how to handle the ATM strategies (see attachment). Now I just wonder how to use the ATM strategy which is active in ChartTrader? Now I can only work with the one that´s written directly in the script.

              Thank you,
              emuns

              PS: it is necessary to place the name of your ATM strategy directly in the script (rows 158 and 165) !!
              Attached Files
              Last edited by emuns; 11-13-2020, 02:38 PM.

              Comment


                #22
                Hi Enums

                Your code works but only after giving a null ref exception on the v first click.
                Any idea why that should be?

                Comment


                  #23
                  I managed to get buy and sell orders on.
                  I have a single issue - a second click ( even without using the modifier key) places a second order!
                  I have tried to prevent this but after 3 hours I give up - perhaps support can enlighten us.
                  As I reset the bool within the logic I don't understand why another click should place an order?

                  I remember having this years ago - couldn't resolve it then either. I am guessing it's something to do with the TriggerEvent method but that's just a guess.
                  NB don't forget to change the ATM Strategy name to your own lines 230 and 240.

                  ClickLimitMine.zip

                  Comment


                    #24
                    Hello emuns,

                    There are a few examples you may find helpful.

                    Below is a link to a forum post on getting the selected atm strategy from chart trader.
                    https://ninjatrader.com/support/foru...775#post752775

                    A link to an example that gets the selected account from chart trader.
                    https://ninjatrader.com/support/foru...98#post1055898

                    A User App Share script that links orders to the parent Atm instance.
                    This indicator serves to provide labels for Atm strategies that are present on your chart. Each new Atm strategy will rotate through the colors defined in your Brush Collection. Simply add to a chart, select the data series you want to have labels added to, choose your font and add all the brushes/colors you want […]


                    As well as an example that places orders through the addon approach with an atm strategy template attached.
                    http://ninjatrader.com/support/forum...555#post515555


                    "Object reference not set to an instance of an object" means a variable used had a null value. With the part of the message "at NinjaTrader.Cbi.Account.Submit(IEnumerable`1 orders);". There may have been an element within the order array that does not have an order assigned, or the array variable itself is null and not instantiated, or something along these lines. Test every variable for null just before its used to find the variable with the null value.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #25
                      i resolved the obj instance issue - but I am not sure why a second click should result in the submission of an order?

                      Comment


                        #26
                        Hello Mindset,

                        This would depend on your logic.

                        Do you have logic to ignore some clicks and not others?
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #27
                          Well yes - it has to be a click with either the Ctrl or Shift key pressed. But after I do that it will submit an order on a simple click ( no keys pressed). Just once. Doesn't repeat.

                          Edit - Clumbsy solution but nonetheless it works; separate logic into two scripts and hey presto everything works!
                          Would still like to understand why if I combine them it gives that odd behaviour on one side and not the other.
                          Last edited by Mindset; 11-16-2020, 08:11 PM.

                          Comment


                            #28
                            Update - whoops - come out of playback and it's leaving orange orders everywhere that I cannot cancel . Why is it so hard to code a simple buy or sell order? it's ridiculous.

                            Click image for larger version

Name:	orange orders.PNG
Views:	1138
Size:	728.6 KB
ID:	1127882
                            Attached Files

                            Comment


                              #29
                              Hello Mindset,

                              Orders most often get stuck because of improper re-use of OCO IDs.

                              Do these orders have OCO IDs?
                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                #30
                                it has an atm strategy attached to it

                                NinjaTrader.NinjaScript.AtmStrategy.StartAtmStrate gy("First", limitOrder);


                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by jclose, Today, 09:37 PM
                                0 responses
                                5 views
                                0 likes
                                Last Post jclose
                                by jclose
                                 
                                Started by WeyldFalcon, 08-07-2020, 06:13 AM
                                10 responses
                                1,414 views
                                0 likes
                                Last Post Traderontheroad  
                                Started by firefoxforum12, Today, 08:53 PM
                                0 responses
                                11 views
                                0 likes
                                Last Post firefoxforum12  
                                Started by stafe, Today, 08:34 PM
                                0 responses
                                11 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