Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ATM Strategy Anomalies

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

    ATM Strategy Anomalies

    Hello,
    I built a PracticeAtmStrategy based on SampleAtmStrategy (odd, I can't seem to export this). The strategy basically works but it leaves old non-functioning Sell Stp and Buy Stp orders hanging on the chart. I refreshed my Sim101 account and that removed them, but the random remaining orders began accumulating again with the next order that triggered. They can't be removed by clicking on the X, or hitting the Close button or Disabling the Strategy. Is there a line of code that would dispense with them? Or some other method? Thank you for any guidance.
    Attached Files

    #2
    Hello JohnS52,

    Thank you for your post.

    Can you please provide a screenshot of the Orders tab from the Control Center showing the stuck orders? It would be helpful to see the status of the stuck orders.

    Also, does the SampleAtmStrategy script included in the platform work fine if you use your Atm strategy template with that script? To test that out, open SampleAtmStrategy in the NinjaScript Editor > Right click within the Editor > Save As to save it as a new script. In this new script, change the atm strategy template used in AtmStrategyCreate() to your strategy template.

    I look forward to assisting further.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Hello NinjaTrader_Gaby,

      Thank you for your response. I changed all the atmStrategyId fields to atmStrategyIdpracticeAtmNQ to see if that would make a difference (no apparent difference). I reset Sim101 again. The strategy still works but still leaves orders in a Cancel Pending state (see attached). I noticed an error message in the log regarding the section that says "You can change the stop price" which I have now commented-out to see if that is what is causing the problem.

      My PracticeAtmStrategy is basically the same as the SampleAtmStrategy except that I changed the EntryLong/EntryShort orders to CrossAbove/CrossBelow (instead of Low[0]) and changed the AtmStrategyTemplate to AtmStrategyTemplateNQ.

      Does atmStrategyId need to be a unique field for each ATM strategy? I have two others that aren't working either and I am trying to figure this out.

      Thanks again.

      Attached Files

      Comment


        #4
        Hello JohnS52,

        Thank you for the screenshots.

        To confirm, you still saw the stuck orders when testing SampleAtmStrategy with your atm strategy template correct?

        If you change "STOP1" to "Stop1" are you still seeing the same error? Similar to how it is used in the code snippet from the method's Help Guide page:



        Yes, the atmStrategyID is a unique identifier for the ATM strategy.



        Please let me know if I can assist further.
        Gaby V.NinjaTrader Customer Service

        Comment


          #5
          I'm catching on. It appears that NinjaTrader sets the unique atmStrategyID for each order - or is there a way to use a get-set method to do it myself?

          Also, as long as AtmStrategyTemplate is found in the AtmStrategy Templates folder, apparently it is not required to use that Atm Template with the strategy: any template will work fine. Is that true?

          Last edited by JohnS52; 03-30-2024, 05:23 AM.

          Comment


            #6
            Hello,

            You can use GetAtmStrategyUniqueId() to generate a unique atm strategy id value.



            When you use AtmStrategyCreate() you need to specify the strategyTemplateName which specifies which strategy template will be used. Any template can be used.



            Please let us know if you have any further questions.
            Gaby V.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Haiasi, 04-25-2024, 06:53 PM
            2 responses
            17 views
            0 likes
            Last Post Massinisa  
            Started by Creamers, Today, 05:32 AM
            0 responses
            5 views
            0 likes
            Last Post Creamers  
            Started by Segwin, 05-07-2018, 02:15 PM
            12 responses
            1,786 views
            0 likes
            Last Post Leafcutter  
            Started by poplagelu, Today, 05:00 AM
            0 responses
            3 views
            0 likes
            Last Post poplagelu  
            Started by fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,407 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Working...
            X