Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug?

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

    Bug?

    I did not know where to post this, so, let me know if this is not the right place. In any case, I am testing a set of strategies. They were running (in test mode, not live) Friday in the morning for about two hours (from 8 to 10 am or so). I was not in the office where I'm testing them; but when I came back about noon I found the internet connection lost. Fixed the network, re-started all the system. NT came back up, started the strategies and when the new data came in it found there was a signal to enter the market at 9:20 or so. I thought it was ok, at least it was recognizing the point where it should have entered the market. Later, right before the market closed, it closed the "position" as it normally would have happened. That is all fine, the problem is that the position was not actually opened. However it was closed with a market order like it would have happened. The thing is that my strategy has in the code the very specific line:

    Code:
    if(Position.MarketPosition == MarketPosition.Long || Position.MarketPosition == MarketPosition.Short)
    meaning that if the position is open then proceed... The position was NOT open and it went through anyways?? what was that all about? You guys have a bug there or am I missing something?
    The other thing is (and I did not notice that one until today) that one position actually STAYED open and I manually closed it this afternoon.
    Of course both transactions produced a loss. Now, will that happen in live mode? what is going on? I'd like to know before I go live with this thing.
    One more question, is there any way to delete those transactions from my records as I don't want to have to move it to excel every time to see how actually my strategy is doing?

    #2
    By the way, I started the strategies from a plot. I opened a plot with all the data I wanted, and THEN I started the strategies from the plot itself.

    Comment


      #3
      lgarcia3,

      There is a difference between a strategy position and your account position. Strategies only know what their strategy position is and nothing about the account position. If your account position is not in sync, as it was here, it does not know about it and can cause unwanted trades on the account.

      Please ensure your account position is in sync with your strategy position when you start up a strategy. In this case your strategy position determined it was in a trade at 9:20. You need to match this position with your account.

      Please see this article: http://www.ninjatrader-support2.com/...ead.php?t=4033
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        ok, sounds good. I have to read and understand that; then I may have some more questions. In the mean time, is there any way to delete those transactions from my "book" so they don't show up there?
        Thanks

        Comment


          #5
          lgarcia3, with 'book' are you talking about your sim account? Unfortunately you can't selectively delete those transactions from it, but you can reset the account under Tools > Options > Simulator > Misc. If you don't want to sync the strategy vs account position up, then start your strategies in 'wait until flat' mode, then live orders will be executed when the strategy is flat from the historical calculated position (On starting a realtime strategy in the Strategies tab - http://www.ninjatrader-support.com/H...tegiesTab.html)
          BertrandNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by nandhumca, Today, 03:41 PM
          0 responses
          3 views
          0 likes
          Last Post nandhumca  
          Started by The_Sec, Today, 03:37 PM
          0 responses
          3 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          6 responses
          33 views
          0 likes
          Last Post ScottWalsh  
          Started by frankthearm, Today, 09:08 AM
          10 responses
          36 views
          0 likes
          Last Post frankthearm  
          Working...
          X