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 Aviram Y, Today, 05:29 AM
        0 responses
        1 view
        0 likes
        Last Post Aviram Y  
        Started by quantismo, 04-17-2024, 05:13 PM
        3 responses
        25 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        7 responses
        34 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cls71, Today, 04:45 AM
        0 responses
        6 views
        0 likes
        Last Post cls71
        by cls71
         
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        216 views
        1 like
        Last Post PaulMohn  
        Working...
        X