Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Submit historical orders

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

    Submit historical orders

    I have changed my settings so that my strategy will automatically submit historical orders instead of waiting until flat. My worry about leaving it at "Wait until flat" is that if I turn off the strategy with an open position and while it is off if I would've received an Exit order, when I turn the strategy back on the position would not be flattened, and the next order would be an entry order, potentially doubling the open position. Please correct me if I am wrong about this.

    When I changed this utnil submit historical it did not submit all historical orders. Also, if orders are being sent that offset each other (enterlong exitlong) how does it handle those.

    Just wondering what best practice is for this feature.

    Thanks

    Shiptastic

    #2
    Hi shiptastic, you are correct - if you use 'Wait until flat before executing live' you will need to make sure that your account position is flat (in sync with the strategy) before starting the strategy, please also see this link here - http://www.ninjatrader-support.com/H...tPosition.html

    The other option would submit all historical working orders upon start up, see this link here for more info about these settings - http://www.ninjatrader-support.com/H...tegiesTab.html
    Last edited by NinjaTrader_Bertrand; 12-31-2008, 08:14 AM.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick response. I have seen the help file on this I'm not exactly sure then if the submit historicals is working correctly.


      For example. I was short 5 units yesterday and turned off the strategy...overnight the strategy would've received the following orders.

      "exit short"
      "enter long"
      "exit long"
      "enter short"

      When I came in and turned on the strategy I was hoping that nothing would happen however after looking at the output the "exit long" and "enter short" were sent and none others. It's most likely the case that I can code in some conditionals into the entries and exits to prevent this but this actually doubled my position short.

      It's strange that the exit long, submitted sell orders even though neither the account nor the strategy thought it was long.

      --------------

      let me start over because I know you guys are very busy the reason I turn the strategy off in the first place is beceause the exchange is down and I need to run a recon with my clearing firm to assure that my position is correct. I do not want erroneous entries being sent.

      Is this how most people deal with this problem or do they code in the time not to trade and simply leave the strategy on.

      Comment


        #4
        Hi shiptastic, your strategy will run through the historical data upon starting and arrive at the current strategy position. If you use the option to submit the live working historical orders, the strategy will place the current working orders that manage this historical strategy position, it will not submit all the historical orders that may have occured in between....

        For your use the best option would be to use a time filter to limit your trading hours, this will ensure you go flat into the overnight and allows you to smoothly start things in the morning - see this reference sample for coding this in - http://www.ninjatrader-support2.com/...ead.php?t=3226
        BertrandNinjaTrader Customer Service

        Comment


          #5
          long/short orders that offset each other, does position go flat?

          Originally posted by shiptastic View Post
          I have changed my settings so that my strategy will automatically submit historical orders instead of waiting until flat. My worry about leaving it at "Wait until flat" is that if I turn off the strategy with an open position and while it is off if I would've received an Exit order, when I turn the strategy back on the position would not be flattened, and the next order would be an entry order, potentially doubling the open position. Please correct me if I am wrong about this.

          When I changed this utnil submit historical it did not submit all historical orders. Also, if orders are being sent that offset each other (enterlong exitlong) how does it handle those.

          Just wondering what best practice is for this feature.

          Thanks

          Shiptastic
          With respect to orders that offest each other (as mentioned previously, enterlong condition is met and then before that position is closed by any other condition, an entershort condition is reached)...I have a statement:

          if (Position.MarketPosition == MarketPosition.Flat)

          in my code that resets a boolean when the position goes flat, and it appears that even though theoretically the account should be "flat" for the split second between when the strategy is closing an open long and entering a new short, it appears that the code never recognizes the account being flat. It seems it goes straight from long to short without ever going flat to reset my boolean. Could someone confirm this is what is happening? If so, should I add some code that says upon exiting any position you must wait one bar before opening a new position, or something like that, to ensure the code sees a flat position? I guess you could also put code in front of the Entershort statement that prevents the Entershort code from running if the current market position is Long, and then vice versa in front of the Enterlong code. If so, any help with the programming (or the best way to program this) for this would be appreciated. Thanks,

          kcsystemtrader

          Comment


            #6
            Hi kcsystemtrader, not sure I completely follow - when you have pure reversal system there never really is a flat condition. You could use BarsSinceExit() to wait for a number of bars until a new trade is entered - http://www.ninjatrader-support.com/H...SinceExit.html
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by iceman2018, Today, 05:07 PM
            0 responses
            0 views
            0 likes
            Last Post iceman2018  
            Started by rhyminkevin, Today, 04:58 PM
            0 responses
            18 views
            0 likes
            Last Post rhyminkevin  
            Started by lightsun47, Today, 03:51 PM
            0 responses
            6 views
            0 likes
            Last Post lightsun47  
            Started by 00nevest, Today, 02:27 PM
            1 response
            14 views
            0 likes
            Last Post 00nevest  
            Started by futtrader, 04-21-2024, 01:50 AM
            4 responses
            49 views
            0 likes
            Last Post futtrader  
            Working...
            X