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

Enter Long/ ATM Strategy Create

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

    Enter Long/ ATM Strategy Create

    When I use a basic Enter Long or Enter Short from the Wizard it says in the NinjaScript when scrolled over:

    "Enter a long position via a market order and close any open short position"

    Which is what I want it to do.

    My question is:

    When using the ATM Strategy Create () for order entry and execution, will it close out any oposite open position like the Enter Long/Short? How about an oposite postion that is being managed by a running ATM strat entered with the ATM Strategy Create ()?

    If NO, is there a some way to get the ATM Strategy () order entry method to do it using NinjaScript?

    Thanks very much for the help! NT Rocks!

    #2
    decklin17,

    It will not. When you use AtmStrategyCreate() it is for calling an ATM strategy. ATM strategies are not correlated with NinjaScript generated orders. From NinjaScript you can do something like call the AtmStrategyCreate() and when you call it you want you can check your NinjaScript positions and just close them via NinjaScript, but this is not tying the two together.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thank you Josh for the quick reply!

      Gotcha...so would I use ATM Strategy Close() to first close an oposite order being managed by a running ATM strat (if so does it need an ATM strat identifier or will it just close any that are running if its left ()?

      And then use a ATM Strategy Create () to open a new one and generate the order entry?


      Or is it better like you said...check you ninja script positions (is that with Position.MarketPosition?) and close it (can you point me to the right method?)

      and then ATM Strategy Create?

      I know its alot of stupid questions, I am just starting the new and exiting world of of none Wizard programing...your time is greatly appreciated!

      Comment


        #4
        decklin17,

        The approach you take is dependent on where your position was generated from. If you generated it from the NinjaScript via a prior AtmStrategyCreate() then you will need to manage it via the AtmStrategy..() methods. If you generated a position via the Enter() methods of NinjaScript you will need to manage those via the Exit() methods.

        A NinjaScript position can be determined by Position.MarketPosition. This will not detect an ATM strategy position.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Ok well lets say i am going the ATM Strat route:

          Originally posted by decklin17 View Post

          So would I use ATM Strategy Close() to first close an oposite order being managed by a running ATM strat (if so does it need an ATM strat identifier or will it just close any that are running if its left ()?

          !

          Comment


            #6
            You will want a strategyId.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              You will want a strategyId.
              Thanks man.

              I did some seriouse forum searching...used the ATM Strategy Create () preloaded as an example and figured it all out....

              Sysytem is basic but running like a champ! You guys rock!

              Comment


                #8
                You are welcome decklin17, thanks for the kind words.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bmartz, 03-12-2024, 06:12 AM
                5 responses
                32 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Started by Aviram Y, Today, 05:29 AM
                4 responses
                13 views
                0 likes
                Last Post Aviram Y  
                Started by algospoke, 04-17-2024, 06:40 PM
                3 responses
                28 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by gentlebenthebear, Today, 01:30 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by cls71, Today, 04:45 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X