Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaScript - ATMstrategy

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

    #16
    Hello,

    Both will work. My ay makes sure that the PT or stop loss was filled. Your way does not.



    if (atmStrategyId.Length > 0)
    {
    // You can change the stop price
    if (GetAtmStrategyMarketPosition(atmStrategyId) == MarketPosition.Flat)
    {

    // My Position is flat either my stop loss or PT got hit so I need to now close out my strategy position.
    ExitShort(10000, "Ex_SH2", "Short2");

    }




    NOTE to make sure we are on same page here:

    - You cannot combine ATM Strategies and NS Strategy order calls. ExitShot will not close the ATMStrategy. It will only close the NS strategy which remember they are not the same.

    - What you are doing here is trying to combine NS strategy with a ATM Strategy. Both will run on the same account and will double your position up. Since the NS strategy is submitting orders and the ATM Strategy is submitting orders.

    -If you want to clsoe an ATM Strategy you need to use this instead.
    BrettNinjaTrader Product Management

    Comment


      #17
      Hello Brett,

      thank you for your support!

      Finally: As you wrote “Before you submit any order, check to see if ATMStrategyID is blank or not.“

      please tell me how I can check. I´ll do of course.I write an indicator to see – but how can one check?

      And is there a possibility to check and verify if there rest a position or limit or stop in the market? (because as you informed with "flatten everything" then there will be flattened positions of other instruments too). So when its possible to check then I can make an indicator or drawing-object that shows there is one, eg background in certain color as long as position or limit or stop.



      Thanks
      Tony

      Comment


        #18
        Hello,

        Thanks for your patience.

        I will respond shortly.
        BrettNinjaTrader Product Management

        Comment


          #19
          Hello,

          Thanks for your patience.

          You will check it with this code as shown in the sampleAtmStrategy.

          if (orderId.Length == 0 && atmStrategyId.Length == 0)


          Finally, there is no way to check the position of your account from an indicator or strategy, only strategy position can be checked.
          BrettNinjaTrader Product Management

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          85 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          48 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          29 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          67 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X