Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to sync accounts from a Strategy ?

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

    Is it possible to sync accounts from a Strategy ?

    Hi Ninjas,

    The eternal non-solved issue yet of syncing accounts when connection-loss has created more posts than any other from years ago and still is around.

    A very easy solution to implement for developers, would be a simple "Info poll from broker's account", compare it to strategy position and submit live orders to equalize them, like it's done from "start a strategy when accounts are selected to be synced with immediately submit live working historical orders".

    While there's no a definitive solution, I'm trying to workaround it through some procedure. For a non very advanced programmer is not an easy task. So far I have this simple snippet to be at least informed of the "sync status"

    Code:
    foreach (Account acct in Cbi.Globals.Accounts)				
    				{				
    					if ( acct.Name == "xxxx")			
    					{			
    						PositionCollection positions = acct.Positions;		
    						foreach (Position pos in positions)		
    						{		
    							if (pos.Instrument.FullName == "$EURUSD")	
    							{	
    								if ( Position.MarketPosition != pos.MarketPosition || Position.Quantity != pos.Quantity; )
    								{
    									SendMail ("[email protected]", "[email protected]", "ALARM: UNSYNCED ACCOUNTS! ", Position.MarketPosition.ToString() + " " + Position.Quantity.ToString()+" Versus IB " +pos.MarketPosition.ToString()+ " " + pos.Quantity.ToString());
    								}
    							}	
    						}		
    					}			
    				}

    Now, questions:
    1. Once the "out of sync" is detected by the Strategy, could it be possible to design an automatic procedure to submit immediate live orders that didn't affect the actual Strategy Position ?
    I don't ask for a source code, just to know if there's a possibility to do it. So far it seems than any automatic order that was submitted, immediately will change the Strategy position.

    2. I'm aware that actually after a connection-loss, there's not any broker's account poll, BUT if previous disconnection, the Strategy submitted a live working order, and let's suppose that this was filled, when the connection is re-established, will NT at least to match that Order Status so my Strategy updates positions ?


    Thanks a lot in advance
    Last edited by pstrusi; 10-11-2015, 07:50 AM.

    #2
    Now, my basic question:
    Once the "out of sync" is detected by the Strategy, could it be possible to design an automatic procedure to submit immediate live orders that didn't affect the actual Strategy Position ?
    The answer, I should think is "no".

    Comment


      #3
      Hello pstrusi,

      Thank you for your patience. I will run this by our product management team and update you as soon as possible.

      Please let me know if you have any further questions in the meantime.
      Michael M.NinjaTrader Quality Assurance

      Comment


        #4
        Hello pstrusi,

        I will answer your questions in order for clarity:

        1) This is not possible as far as I am aware. If so, it is undocumented.

        2) Yes, this should be happening. There are errors that will arise if the sync of orders fails.

        Please let me know if I may be of further assistance.
        Michael M.NinjaTrader Quality Assurance

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by WHICKED, Today, 12:56 PM
        2 responses
        15 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Felix Reichert, Today, 02:12 PM
        0 responses
        1 view
        0 likes
        Last Post Felix Reichert  
        Started by Tim-c, Today, 02:10 PM
        0 responses
        1 view
        0 likes
        Last Post Tim-c
        by Tim-c
         
        Started by cre8able, Today, 01:16 PM
        2 responses
        9 views
        0 likes
        Last Post cre8able  
        Started by chbruno, 04-24-2024, 04:10 PM
        3 responses
        49 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X