Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Sync with 8.0.0.12

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

    Strategy Sync with 8.0.0.12

    Are there any changes in 8.0.0.12 re.
    Sync Account Position?

    I have a strategy that on a long signal calls ExitShort + EnterLong + ExitLongLimit and on a short signal calls ExitLong + EnterShort + ExitShortLimit.

    All works ok but when re-loading the next day I'd like to synchronize it with existing positions & limit orders.

    are there any easy functions like AdoptPositions() or AdoptOrders() etc.in 8.0.0.12?

    I may have this wrong but currently it feels like I can synchronize my strategy positions whilst loosing my limit orders or re-build my strategy limit orders but not my positions?
    Last edited by delTik; 09-05-2016, 06:59 AM.

    #2
    Hello delTik, and thank you for your question. As you may be aware, the options Ninja 8 has built-in to sync account position are, as is the case with Ninja 7, designed to sync your account's position to your strategy's position. What you may have observed in that thread is that there was an at the time undocumented members Account and Account.Positions which contains a FindByInstrument method. That functionality is now documented.

    Account (has sample code)


    Account.Positions


    With this account position instrument, it may be possible during the last historical bar to sync your strategy's position to your account position. Doing so is still at this time up to the programmer.

    I have requested your vote be added for this feature. Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      ok thanks.

      With this account position instrument, it may be possible during the last historical bar to sync your strategy's position to your account position. Doing so is still at this time up to the programmer.
      do you have example code of how to add positions and stop/limit orders to a strategy so it matches the real account?

      frankly a bit surprised that this issue is so unclear or is it me?

      untested but have written this to count real position qty ...

      Code:
      		public int accountPosQty(Account ac, Instrument i)
      		{
      		   	int cnt=0;
      		   	foreach(Position position in ac.Positions)
      		    	if (position.Instrument == i)
      		      		cnt += position.Quantity;
      			return cnt;
      		}
      Last edited by delTik; 09-05-2016, 07:53 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by traderqz, Yesterday, 09:06 AM
      3 responses
      21 views
      0 likes
      Last Post NinjaTrader_ThomasC  
      Started by f.saeidi, Today, 10:19 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by kujista, Today, 06:23 AM
      5 responses
      17 views
      0 likes
      Last Post kujista
      by kujista
       
      Started by traderqz, Today, 12:06 AM
      3 responses
      6 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by RideMe, 04-07-2024, 04:54 PM
      5 responses
      29 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X