Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add positions

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

    Add positions

    Hello, sorry for my English is not my native language.

    question is:
    How can I add to the previously open positions ?

    My strategy is to market in phases, opening one lot at a time, not to fall into a pit in superDOM.

    as an example:
    opened a position to buy 1 lot, then add as many times as necessary, and each time the amount of is equal to 1 lot.

    When it came time closing positions - they are closed in the same way - at one time one lot.

    please tell me how to do this in the strategy?

    #2
    Hello,

    Thanks for your note.

    Are you using the strategy wizard or NinjaScript?

    Also, are you using EnterLong() or EnterLongLimit()?

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Brett View Post
      Hello,

      Thanks for your note.

      Are you using the strategy wizard or NinjaScript?

      Also, are you using EnterLong() or EnterLongLimit()?

      I look forward to assisting you further.
      I'm using NinjaScript
      and :

      EnterLong();
      EnterShort();
      ExitLong();
      ExitShort();

      Comment


        #4
        Hello,

        In this case make sure that you only call EnterLong() once per time you want to enter.

        Then when your secondary condition is ready to enter again. Do another EnterLong().

        Make sure that when you start the strategy also, that in the parameters to start the strategy there is a setting for EntriesPerDirection. Make sure to set this to the number of scale ins you would like. For example if you want to scale in once. This needs to be set to 2. To allow a maximum of 2 EnterLongs() per direction.

        To insure that your entry conditions are only sent once you will need to make sure to do a if(Position.MarketPosition == MarketPosition.Flat) before going long your first time. Then you will need to have your secondary god ready and outside of this if statement on when to scale in.

        Let me know if I can be of further assistance.
        BrettNinjaTrader Product Management

        Comment


          #5
          Originally posted by NinjaTrader_Brett View Post
          Hello,

          In this case make sure that you only call EnterLong() once per time you want to enter.

          Then when your secondary condition is ready to enter again. Do another EnterLong().

          Make sure that when you start the strategy also, that in the parameters to start the strategy there is a setting for EntriesPerDirection. Make sure to set this to the number of scale ins you would like. For example if you want to scale in once. This needs to be set to 2. To allow a maximum of 2 EnterLongs() per direction.

          To insure that your entry conditions are only sent once you will need to make sure to do a if(Position.MarketPosition == MarketPosition.Flat) before going long your first time. Then you will need to have your secondary god ready and outside of this if statement on when to scale in.

          Let me know if I can be of further assistance.
          Sorry, but I do not understand.
          example:
          trading order generate a separate program, and sends it to the Ninja, writing to a file.
          Ninja reads this file and trades on them.
          the first trading order is triggered, all the rest do not.
          I attach the script code:
          Attached Files

          Comment


            #6
            Hello,

            Unfortunately, I'm unable to debug an entire script.

            You would need a hire a NinjaScript consultant to do this. Or you would need to simplify the strategy down to a simple strategy that still exibits the issue that I can look into. For example. Strip out the file access and things like that so that you have a simple strategy that EnterLong() twice successfully and go from their.



            Also, you add Print() lines to your code and debug the strategy this way.



            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment


              #7
              Originally posted by NinjaTrader_Brett View Post
              Hello,

              Unfortunately, I'm unable to debug an entire script.

              You would need a hire a NinjaScript consultant to do this. Or you would need to simplify the strategy down to a simple strategy that still exibits the issue that I can look into. For example. Strip out the file access and things like that so that you have a simple strategy that EnterLong() twice successfully and go from their.



              Also, you add Print() lines to your code and debug the strategy this way.



              Let me know if I can be of further assistance.
              I do not need to debug the script.
              I want to get a clear answer to my question:
              Why not add orders to a ninja?
              My script opens only ONE order and then do not add to it orders .

              I bought the paid version of the ninja, and I hope for your help.

              Comment


                #8
                Hello,

                This would be a question I would be unable to answer without debugging the script.

                The only obvious simple answer is when you start the strategy what did you set Entries Per Direction too?

                Other then that I would need to add in Print() Statements on where I expect a scale into the strategy. To make sure my code works as I expect and the code scales into the strategy.

                This would take adding in Print statements and debugging the code.

                I looked through your code but do not see anything obviously wrong.
                BrettNinjaTrader Product Management

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                571 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                331 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
                549 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                549 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X