Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simulator Locks

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

    Simulator Locks

    I have a very profitable strategy that I'm currently simulating with hopes of moving to production very soon. It evaluates the market every 5 minutes and trades accordingly.

    However, this afternoon I noticed that the strategy's unrealized gain column stopped updating. From all appearances, the strategy is not updating and appears locked. It does not look like it is evaluating the strategy even though it is still in an Open position. I simply can't have this occur if I begin to use this on a live account.

    I have it connected to TD and Ninja continues to function properly. It just appears that the strategy is locked with an open trade. I can't be in front of my computer at all times, so trust in the software is paramount. Any help is appreciated.

    #2
    While this happened are you sure your data was still flowing? If no data is coming in then your strategy would "halt".
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Yeah, it was still connected and could pull up live charts. I think it's something with the simulator. To fix the situation, I stopped the strategies and reset the sim account to get rid of all the orders. I then shut down Ninja and restarted. When I got back in, I added the strategies again and started them. At this point, Ninja creates an order on the long side and the unrealized gain is updating as it should. However, when I go to the *Orders* tab, there is only one entry with an action of *SellShort* and type *Limit* and state of *Working*. There is no record of the Long order at all. Crazy. At the same time, the Positions tab showed no positions.

      Now since then, I've let the strategy continue to run and it has issued *BuytoCover* orders to close the trade - realize that this strategy has no short logic in it whatsoever. So there are no active orders at all in the *Orders* tab and the *Strategies* tab shows no position. However, now in the *Positions* tab, it shows an open position and the PnL continues to update. What is going on???

      I sure wouldn't expect this level of craziness after I reset the sim account and closed Ninja.

      Any help is appreciated as I would really like to trade this strategy live, but hesitate to subscribe to a live account if these issues will be evident during live trading.

      Note::
      I have noticed one issue that might trigger these events. Since I have a profit target, the Buy order is followed by two sell Limit orders - one having the majority of shares and the other the remainder. When the limit price is reached, every so often, on the *Orders* tab, it will fill only one of the limit orders and still show the other as *working*. However the strategy will show the entire order as closed, the *Executions* tab will show both limit orders as filled, and the *Positions* tab will display correctly. But these strange sellshort orders and such seem to follow these events. Just an observation...

      Comment


        #4
        sublime,

        Please be aware of the difference between a Strategy Position and an Account Position. You are seeing the simulated Strategy Position which is kept track of for proper strategy calculations. http://www.ninjatrader-support2.com/...ead.php?t=4033

        An option that may interest you is the "Wait until flat before executing live" option in Tools->Options->Strategies->NinjaScript.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Interesting,

          1. But why would a strategy ever get into a short position regardless of when it was started, if shorting is not part of the strategy? Especially starting with a blank sim account.

          2. Also, in the provided scenario where the strategy is started 1 hour after the market and the simulator determines the strategy should still be in an open long position. Will the strategy show a long order in the *orders* tab or will it just show the sell order when it closes?

          3. Relating to the above, in a live account, if you start a strategy after the market opens, will the strategy just start at the next bar to determine if it should create an order? or will it do like above and try figure out if it would have been in a position and issue an order immediately.

          I'll check out the "Wait until flat before executing live"... can you highlight briefly what it does?

          thanks for you help.

          Comment


            #6
            1. I cannot explain that. You will need to debug it with TraceOrders = true to see where it submits a short order.

            2. Depends on what you have the "Wait until flat" setting set to. If you have it set as Wait until flat you will see no orders until you have reached a flat state. Then after that you will see your first long order.

            3. Again, it depends on the setting you select.

            The setting does what it sounds like it does. It will wait until the strategy reaches a flat state before ever submitting a live order. If you start your strategy and it is long it will wait until that closes and then wait until the next long trade comes along before submitting any live orders. The other option just starts right off the bat. If you were long and then your strategy sold that position you will see that as a live trade and ultimately you end up with a short position in your Account Position, but a flat in your Strategy Position. This is quite possibly the reason for #1.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Radano, 06-10-2021, 01:40 AM
            20 responses
            615 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by Mizzouman1, Today, 07:35 AM
            0 responses
            4 views
            0 likes
            Last Post Mizzouman1  
            Started by i019945nj, 12-14-2023, 06:41 AM
            6 responses
            66 views
            0 likes
            Last Post i019945nj  
            Started by aa731, Today, 02:54 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by BarzTrading, Today, 07:25 AM
            0 responses
            3 views
            0 likes
            Last Post BarzTrading  
            Working...
            X