Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ninja trader7

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

    ninja trader7

    Hi, dear tech support,


    i have two related question regarding auto live trading through ninja script in ninja 7

    If I attach a live strategy, for example when one sma crossabove another than buy, I want it to be executed when the condition happens after I start running the strategy. So after I attached a strategy, the initial position is always flat regardless how many crossovers may have occurred before I attach my strategy. Is this the default setting for ninja trader7?



    Also, if I set the strategy as one order per direction, when an order is filled, there should be no entries before the exit of the first entry even if the entry condition is satisfied. However, if the first entry is still there after I shut down the program. When I restart ninja trader the next day, will it automatically recognize that the position is not flat and therefore won’t enter the market unless the position become flat?



    thanks in advance!

    #2
    Try,

    Code:
    if (Historical)return;

    Comment


      #3
      i am sorry but i dont quite get what u mean...

      Comment


        #4
        light7801, you could start your strategies in 'WaitUntilFlat' mode, this means the act on the first freshly generated entry signal after you started them up -

        Comment


          #5
          Hi Bertrand, that's cool but let's say if i restart a strategy and let's assume there is one long position for my account, will the script auto detect the position? and if the position already meets the exit condition, will the script auto execute it right away? thanks for clarification!

          Comment


            #6
            light7801,

            To clarify, when you are using WaitUntilFlat, it doesn't do anything with your currently held long position. WaitUntilFlat means it will wait for the strategy to reach a strategy flat position and then begin placing live orders after that. If you keep holding your long position then that would be erroneous as that will not be in sync with the strategy position when it actually starts going live.

            If you want to have NT auto close that long position you will have to turn Sync Account Position to true. When using WaitUntilFlat in conjunction with Sync Account Position it will auto close any account positions and wait for the strategy to reach a strategy flat before submitting live orders.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Hi Josh, to make is simple, i am wondering if ninja script can handle this scenario:

              condition 1: buy, condition 2: sell entry per direction: 1

              on day 1, condition 1 is met, so i entered a long position, however, condition 2 is not met so i still hold this position;

              on day 2, (restart ninja and set it to run) condition 1 is met again but not condition 2; however, since only 1 position is allowed, no more position will be added. so at the end of day 2, i still have 1 position;

              on day 3, (restart ninja and set it to run) condition 2 is met. then the script will execute an exit order. after the position goes to flat, any upcoming condition 1 will result a new entry and the circle is complete.

              can ninja trader be configured to handle this scenario? if yes, how to do it? thanks very much!!

              Comment


                #8
                Light, this is possible - just ensure to use ExitLong() then for your 'Sell' and not EnterShort().

                Comment


                  #9
                  so how to i set the configuration for the waituntilflat mode and the Sync Account Position mode? anything else i need to pay attention to? thanks!

                  Comment


                    #10
                    could somebody answer my inquiry? thanks a lot in advance!!

                    Comment


                      #11
                      light7801,

                      These options will require you to have NT7. Please ensure you are using NT7 first. The WaitUntilFlat option is in Tools>Options>Strategies>NinjaScript and the Sync option is in the strategy selection dialogue window when you are first starting up your strategy.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        CCI indicators

                        Hi,

                        I migrated to NT7 and the CCI indicators look really different according to ones in NT6.5. There are different values in NT7 and NT6.5. Can you help me? Thanks.

                        Comment


                          #13
                          richi, are you talking about the built in CCI indicator? Can you post screenshots showing the big difference?
                          AustinNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          650 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          370 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          109 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          574 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          577 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X