Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Detecting open position values

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

    Detecting open position values

    Is it possible for NinjaScript to detect the average price and share size of a position previously opened outside of the strategy. For example, a strategy primarily for manageing and exiting a position. If I manually enter a position and then start a strategy I want it to detect the size and price of the manual entry.

    #2
    Hi JKrider,

    Unfortunately not, only entires placed by the strategy, in that instance of the strategy can be accessed for information.
    TimNinjaTrader Customer Service

    Comment


      #3
      Thanks, that's what I feared. The info is obviously there for NT. Any idea if this is planned for the future?

      Comment


        #4
        Hi JKrider,

        Thank you for your input, I will submit this to our development team for future consideration.
        TimNinjaTrader Customer Service

        Comment


          #5
          One final question. I am live with IB. IB forces a close once each day. Does that mean it is impossible to use NT strategy for a long term position? If the strategy gets into a position today. IB forces a shutdown. Then tomorrow the strategy would have to be restarted and NT would not be able to recognize the prior position?

          Comment


            #6
            Hi JKrider,

            Upon disconnect, you can reconnect and restart the strategy, then sync the position manually by submitting an order in NinjaTrader is necessary.
            More info at - http://www.ninjatrader-support.com/H...ccountPosition

            With NinjaTrader 7, strategy persistence will make this process easier.
            More info at - http://www.ninjatrader.com/support/h...tegies_tab.htm under NinjaScript tab
            TimNinjaTrader Customer Service

            Comment


              #7
              OK. Let me understand. Scenario 1: in a position with both Strategy and Account positions the same. End of Day, I stay open in the account. Next day i start strategy and synch. A - if no new strategy position in the morning, the strategy finds yesterday position, opens and agrees with Account. When strategy closes it will close the account. B - Strategy opens in morning, finds a new entry, submits order and now the strategy shows 1 lot while account is 2 lots. So, i have to sell 1 lot to synchronize. C - in morning the strategy finds a trade in opposite direction. It is short 1 lot, account long 1 lot. I have to sell two lots to synchronize. Scenario 2: End of Day i close my position and the strategy quits running, but had not exited the position. A - Next morning the strategy picks up from yesterday and shows long 1 lot while I am flat. I manually enter a position to synch, but the prices are obviously different. B - It opens in morning and the conditions are such to close the position. Now strategy and account are the same.

              If this is the case, I understand, but this is a lot of work if running swing strategies on 15 - 20 stocks. Again, the information is available to NT as shown in the Control Center Position Tab. It has instrument, side, Qty, Avg Price, Account, Connection. If there is some way to access this information via the strategy then it would be simple programming to keep the strategy and account synchronized without the acrobatics.

              Comment


                #8
                Hi JKrider,

                Yes, if there is a discrepancy, you will need to sync manually if your strategy is set to submit live working order immediately.

                With NT7, those values have been used to implement the strategy persistence:
                TimNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                23 views
                0 likes
                Last Post algospoke  
                Started by ghoul, Today, 06:02 PM
                3 responses
                14 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                45 views
                0 likes
                Last Post jeronymite  
                Started by Barry Milan, Yesterday, 10:35 PM
                7 responses
                22 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by AttiM, 02-14-2024, 05:20 PM
                10 responses
                181 views
                0 likes
                Last Post jeronymite  
                Working...
                X