Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Automated Trading and Order Submission

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

    Automated Trading and Order Submission

    I have developed a Ninja Script and have put it on auto trading; kindly guide me on how to do the settings so that following does not happen.

    1. As the strategy throws an order it will automatically be submitted to the live exchange, suppose due to some reason I have to restart the machine and the strategy generated order goes away due to reloading of the data, the computer should not automatically square up the position.

    2. Similarly if Iam flat and on reloading the data due to restarting of the computer, the strategy generates a buy order, it should not automatically get submitted. This is because the price may be very different.

    Suppose I am long one position & the corresponding stop loss & profit target have automatically been put in the exchange. Suppose, I shut down my system for some reason & restart the strategies what would be the status of the following:

    1. Will my stop loss & profit target orders that had been put into the system automatically would have got cancelled (at the exchange level) because I stopped my strategy & had the tab “cancel strategy orders on termination” checked as okay; or they would still exist into the system & the exchange.

    2. Since I am restarting my strategies based on the historical fill, will it again submit a buy order by default into the exchange if I have the tab "immediately submit live working historical orders" checked okay.

    3. Which is a better way of order handling - per entry execution or by strategy position?


    thanks!
    Last edited by kassaindia; 02-09-2010, 03:15 AM. Reason: more queries

    #2
    kassaindia, please review this important info on synching strategy vs account positions -



    If you don't want to submit orders as the strategy starts up, just the WaitUnilFlat option, this will only submit orders for a freshly generated entry signal after the strategy was started -



    There's no 'better' order handling option, as it differes what you individually would need, if you scale in and out of positions, please use PerEntryExecution.

    If you have check to cancel orders on strategy termination, the script would cancel those, but you still need to check if there's any open position you would need to take care of...

    With the 'immediately submit' the strategy sends orders if the situation at startup time warrants this.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      If you don't want to submit orders as the strategy starts up, just the WaitUnilFlat option, this will only submit orders for a freshly generated entry signal after the strategy was started -
      Betrand can you please clarify.
      According to ninja website,


      Wait until flat before executing live
      "When a NinjaScript strategy that relies on historical data to calculate it's current position and orders state is started, it will wait until the strategy position has a flat position before executing any live orders."

      This is different from what you are saying.
      According to the website, if the option is checked, it will wait until the strategy is FLAT before submitting any live orders.

      But according to you, if the options is checked it "will only submit orders for a FRESHLY generated entry signal after the strategy was started".

      The 2 statements mean different things.

      thanks

      Comment


        #4
        Hello aljafp,

        It basically means the same; the strategy will wait with submitting orders to your account until your strategy is flat. A freshly entry signal would refer to an entry order that is submitted once your strategy position is flat.

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          If you don't want to submit orders as the strategy starts up, just the WaitUnilFlat option, this will only submit orders for a freshly generated entry signal after the strategy was started.
          Could you tell me how to put WaitUntilFlat directly into my strategy script? I tried putting WaitUntilFlat = true; in the Initialize section, but it wouldn't compile.

          I would rather do this than rely on the Options>Ninjascript settings.

          Comment


            #6
            yamdigger, I will have someone get back to you tomorrow regarding the correct syntax to use for the WaitUntilFlat option.
            AustinNinjaTrader Customer Service

            Comment


              #7
              yamdigger, unfortunately setting this option programmatically is not supported.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              69 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              42 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              24 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              27 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              54 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X