Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cancel Order on ATM Strategy

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

    #46
    MrTicks, thanks a bunch. This will be a great learning tool.
    AustinNinjaTrader Customer Service

    Comment


      #47
      Originally posted by NinjaTrader_Austin View Post
      MrTicks, thanks a bunch. This will be a great learning tool.
      Hi Austin, I would post it up on the NinjaScript file sharing version 7 strategy section but it's closed to me for some reason.

      I can upload to the 6.5 section but I created this on version 7.0.0.19.

      Comment


        #48
        MrTicks, please try again. I just opened up the category to allow anyone to post.
        AustinNinjaTrader Customer Service

        Comment


          #49
          Originally posted by NinjaTrader_Austin View Post
          MrTicks, please try again. I just opened up the category to allow anyone to post.
          Thanks, will do.

          Comment


            #50
            Mr Ticks,

            Thanks for posting the CANCEL code.
            I'm continuing to look at this for things you've mentioned regarding placing a Buy and Sell order at the same time or not stacking orders. I understand these could be resolved with bool flags to keep you in one direction or one trade only at a time.

            Another advancement of your code could be a CHANGE code.
            I'm looking at some code I was previously attempting to alter the entry order in a "chase" type mode. ie if the order is not filled within the first 2 bars after pending entry, use the AtmStrategyChangeEntryOrder to adjust to a new orderPrice:
            Code:
            double changedOrderPrice = //set new order price level...
            [SIZE=2]AtmStrategyChangeEntryOrder(changedOrderPrice,0,orderId);
            [/SIZE]
            I'll continue to do some testing on StopMarket entry prices and using print statements or DrawRay to emulate the Chart Trader on the Strat chart.
            Thanks for sharing your continuing progress.
            Kirk

            Comment


              #51
              Originally posted by zeller4 View Post
              Mr Ticks,

              Thanks for posting the CANCEL code.
              I'm continuing to look at this for things you've mentioned regarding placing a Buy and Sell order at the same time or not stacking orders. I understand these could be resolved with bool flags to keep you in one direction or one trade only at a time.

              Another advancement of your code could be a CHANGE code.
              I'm looking at some code I was previously attempting to alter the entry order in a "chase" type mode. ie if the order is not filled within the first 2 bars after pending entry, use the AtmStrategyChangeEntryOrder to adjust to a new orderPrice:
              Code:
              double changedOrderPrice = //set new order price level...
              [SIZE=2]AtmStrategyChangeEntryOrder(changedOrderPrice,0,orderId);
              [/SIZE]
              I'll continue to do some testing on StopMarket entry prices and using print statements or DrawRay to emulate the Chart Trader on the Strat chart.
              Thanks for sharing your continuing progress.
              Kirk
              I think I saw a sample of that being used somewhere. I'll see if I can dig it up.

              My next project is to look at only having one position on per instrument at a time. My strats have buy/sell signals combined in them but would like to work on getting the code for only one trade at a time also as I end up getting stopped out of good positions and then there are two stop loss orders left open that I have to manually cancel.

              Comment


                #52
                Mr Ticks and other ATMStrategy users/coders,

                Here is my latest attempt to use ATMStrategy template. I've started with your CANCEL code and added the CLOSE and CHANGE elements. Also, I've got a text box for the current trade status and DrawRays for emulating the ChartTrader.

                Please try it out and see if there's other things that could be tweaked/modified or totally rewritten. The results might not be profitable at this stage because I'm really just checking the functionality of the components.

                If some graphics don't disappear when they're supposed to, I think adding some "RemoveDrawObjects()" could be added to the code.

                If you're using v7.20 like I am, I'd be curious to hear of your results.


                Thanks,
                Kirk
                Attached Files

                Comment


                  #53
                  Hi Kirk,

                  I'll give this a whirl tomorrow. Am going to try and write a pivot point related entry signal with ATM call and cancel order attached. Will hopefully have some feedback for you on Friday.


                  Thanks.

                  Comment


                    #54
                    the NEW "latest"

                    Mr. Ticks,
                    I've got a newer version which I've been tweaking all day.
                    Please let me know if you have any changes/tweaks that will improve the code. FWIW, I'm still sorting out my own personal "secret sauce" entry criteria. This code more or less shows functionality of ATM strategies but isn't necessarily profitable.

                    Hope you can benefit from the code.

                    Kirk

                    Comment


                      #55
                      Originally posted by zeller4 View Post
                      Mr. Ticks,
                      I've got a newer version which I've been tweaking all day.
                      Please let me know if you have any changes/tweaks that will improve the code. FWIW, I'm still sorting out my own personal "secret sauce" entry criteria. This code more or less shows functionality of ATM strategies but isn't necessarily profitable.

                      Hope you can benefit from the code.

                      Kirk
                      Hi Kirk,

                      I'll hopefully get to test code later on. If not, it'll be after the weekend before I get to try it out.

                      Feel free to share the "secret sauce"!


                      Gavin.

                      Comment


                        #56
                        Just kicked this off on the DAX and FTSE with a sim account on live data. Will see how it behaves change entry wise.

                        Comment


                          #57
                          nice !

                          small questions,

                          when I came upon this tread I though to myself I found the holly grail ! seriously ! I have been trying to do this for a long time ! and bam done! Thank you !

                          but my questions was , what advantage doe doing a Atm strategy instrad of just if (bla bla bla) , buylimit , set a profit target, and loss, and use cancelorder() in onorderstatus() when the price would increase or drop , away from your order? this is what I was trying to do, and I will probably switch to Atm , but I figured I would ask.

                          JP

                          Comment


                            #58
                            Originally posted by chancehero View Post
                            small questions,

                            when I came upon this tread I though to myself I found the holly grail ! seriously ! I have been trying to do this for a long time ! and bam done! Thank you !

                            but my questions was , what advantage doe doing a Atm strategy instrad of just if (bla bla bla) , buylimit , set a profit target, and loss, and use cancelorder() in onorderstatus() when the price would increase or drop , away from your order? this is what I was trying to do, and I will probably switch to Atm , but I figured I would ask.

                            JP
                            It's a trail stop thing. Some people like to let the position run if it goes their way.

                            Comment


                              #59
                              Help please

                              Anybody could tell where is the root folder of ATM strategy template that are built in the SuperDom? Please help.

                              Comment


                                #60
                                Those templates are stored in the database luxurious_04, which would be included in the backup file if you choose to build one.
                                BertrandNinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by trilliantrader, Yesterday, 03:01 PM
                                3 responses
                                30 views
                                0 likes
                                Last Post NinjaTrader_Clayton  
                                Started by cmtjoancolmenero, Yesterday, 03:58 PM
                                4 responses
                                26 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by Brevo, Today, 01:45 AM
                                1 response
                                14 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by rjbtrade1, 11-30-2023, 04:38 PM
                                2 responses
                                74 views
                                0 likes
                                Last Post DavidHP
                                by DavidHP
                                 
                                Started by suroot, 04-10-2017, 02:18 AM
                                5 responses
                                3,022 views
                                0 likes
                                Last Post NinjaTrader_Gaby  
                                Working...
                                X