Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Selected ATM Strategy not Executing correctly

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

    Selected ATM Strategy not Executing correctly

    Hello,

    Bit of a complicated one here.
    I have built this tool for someone and it works great most of the time, It is made to submit ATM orders when a stopmarket order is rejected. So it is subscribed to the accounts OnOrderUpdate and when it detects a rejected stop it will execute a Market ATM in the direction of the stop.

    I am not able to replicate this on my machine but for some reason the ATMs that are being submitted after a rejection will start to set their stoploss 2 ticks away. This causes some more rejected stops and a flurry of action (Understandable because the script is meant to detect rejected stops) but still for some reason during that flurry it is placing the ATM stoploss 2 ticks away.

    I am having it detect the ATM that is selected in the Chart Trader (It is subscribed to OnATMSelectionChange and will just update when it is changed) and the ATMStrategy is saved into an ATMStrategy object so there should be no confusion. Let me know if this makes sense. I cannot recreate on my machine so it makes things difficult. They are using Rithmic which I know can cause problems but the execution of the ATM I wouldn't think the connection would matter.

    Thanks!

    Can email log and trace if needed. They are too big to attach

    #2
    Hello Vikuno1,

    From the given details there is really nothing that sticks out that would be a problem. Because the script is submitting the atm you will likely need to add debugging into the script and also make a custom template to test with on that machine and then debug the script directly on that machine. That would really be the only way to determine what specifically is happening in that situation.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello Vikuno1,

      From the given details there is really nothing that sticks out that would be a problem. Because the script is submitting the atm you will likely need to add debugging into the script and also make a custom template to test with on that machine and then debug the script directly on that machine. That would really be the only way to determine what specifically is happening in that situation.
      Thank you for your reply, at this point I am so confused I don't even know what to look for. It doesn't make any sense to me at all how it would randomly start to submit the selected ATM with a different stop. Am I able to check the stop value before it submits so that I can just cancel that one?

      Comment


        #4
        Hello Vikuno1,

        The stops are generated based on the settings in the template, there is no way for a strategy to know ahead of time what the calculated values will be. You would have to wait until the entry fills and the targets are submitted before you can access information about them. The best course of action would be to debug the strategy on the machine that is having a problem so you can ensure the correct template and other settings are being used.

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello Vikuno1,

          The stops are generated based on the settings in the template, there is no way for a strategy to know ahead of time what the calculated values will be. You would have to wait until the entry fills and the targets are submitted before you can access information about them. The best course of action would be to debug the strategy on the machine that is having a problem so you can ensure the correct template and other settings are being used.
          So thats the thing, the template is saved as soon as the indicator is initialized and doesnt change ever but after enough rejected orders it suddenly start submitting ATMs with only 2 Tick stops instead of the templates’s 24 Ticks.

          The method I use is Account Start ATM method and I input the actual ATM object not even the template name so I am confused as to how it could screw up.

          Would a mock indicator help? I can send you a version if it, the tough part is I can’t even recreate on my machine either. It is specifically on his.

          Sorry a bit lost here, how would you proceed? I already tested on their machine and recreated the error, doesnt make any sense why it would stop executing the correct ATM when it works perfectly for the first 5-10 trades but then randomly stops working when nothing changed

          Thanks!

          Comment


            #6
            Hello Vikuno1,

            If you are creating the template in code I would suggest to try and manually configure a template and test with that. You can upload a test script but it would need to use a manually generated template from one of the order submission tools. Please also include the steps you used to see the problem.

            Comment


              #7
              Originally posted by NinjaTrader_Jesse View Post
              Hello Vikuno1,

              If you are creating the template in code I would suggest to try and manually configure a template and test with that. You can upload a test script but it would need to use a manually generated template from one of the order submission tools. Please also include the steps you used to see the problem.
              Ill whip up a test script with what I am doing.

              I am not creating a template in the code, I am saving the current selected ATM in the chart Trader (when the indicator is loaded on a chart) into an ATMStrategy variable and then submitting that order with the StartATM function. It is not a strategy, it is an Indicator that is submitting account orders.

              I’ll send the test script with steps and everything here in a bit.
              I know you are super busy so I really appreciate your time.

              thanks!

              Comment


                #8
                Hello Vikuno1,

                Thanks for the update about the template. Please include the template file you created as well in this case so I can test using the same settings in the template.

                Comment


                  #9
                  Originally posted by NinjaTrader_Jesse View Post
                  Hello Vikuno1,

                  Thanks for the update about the template. Please include the template file you created as well in this case so I can test using the same settings in the template.
                  Found the solution, looks like when I changed it to just read the template name instead of hold the ATMStrategy object it works like a charm (Tried that before but guess I didn't try that correctly). This thread can be closed, thanks!

                  Comment

                  Latest Posts

                  Collapse

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