Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sync and basic functionality

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

    Sync and basic functionality

    Hello,

    I'm trying to use NT8 desktop. Latest version. I have a strategy going through Rithmic data for a prop firm. My strategy has since been trying to put in orders but somehow makes the whole platform crap the bed and stop working. It changes "sync" to false and will not allow any orders to be put through. It stops the algorithm. No orders are active. The chart is updating normally. I can't seem to figure out why NT keeps failing. What is the "sync" thing that it's synchronizing to and how to I get it to stop giving itself fatal errors every minute. The purpose of an algorithm is to have it automatically work. Not to have to keep poking the platform and turning toggles off and on again, closing and reopening, and other "voodoo handwaving" to make things function. Anyone else deal with this and have a solution?

    #2
    Hello alphatango,

    Thanks for your post.

    The 'Sync' column in the Strategies tab of the Control Center reports true if the Strategy Position and Account Position match. If the Strategy Position and Account Position do not match then the 'Sync' column will report false.

    Note that Strategy Positions are separate from actual Account Positions.

    See this help guide page for more information about Strategy Position vs Account Position: https://ninjatrader.com/support/help..._account_p.htm

    A Strategy Position could become out of sync with the Account Position for a number of reasons, such as running multiple NinjaScript strategies on the same instrument/account combination, or manually submitting trades on the same account/instrument combination that the strategy is enabled on.

    Note when a strategy is enabled, it processes historical data to determine trades that the strategy would have made on the data that is already on the PC/chart and to determine what position the strategy is in. (Strategy positions are separate from actual Account positions.)

    When a strategy is yellow (or orange on some monitors) in the Strategies tab of the Control Center, this means that the strategy entered a historical (theoretical) position in the historical data that has been loaded. It also means that you have "Wait until flat" selected for the 'Start behavior' option in the strategy parameters.

    This means that once the strategy has finished processing the historical data and has transitioned to real-time, it will wait until there is a real-time order submission that will cause the strategy to become flat. This also includes changing from a long position to a short position or vice versa as the position would pass through flat.

    This also applies to secondary instruments if there are added series to the script. All positions must be flat before real-time orders will begin.

    ​You can change the start behavior to "Immediately submit" in the parameters of the strategy. Immediately Submit automatically submits working orders from when the strategy processed historical data, and assumes the strategy position and account position are where you want it when you enable the strategy. This is typically used to have a strategy resume a position after disabling/enabling. If the strategy already had live orders running, the orders will resume with the new enablement of the strategy if they match the historically calculated orders. If the orders calculated from historical data do not match the live working orders, the live working orders will be cancelled and replaced by those calculated from historical data.

    Sync Account Positions is an additional option that has NinjaTrader submit an order to sync the account position to the position calculated by the strategy. (Not the other way around.)

    If you do not want the strategy to calculate a position from processing historical data. Simply add if (State == State.Historical) return; to the top of your strategy logic so historical processing is skipped. The strategy will then always start from a flat position because it has not calculated any orders.

    See the help guide documentation about Syncing Account Positions: https://ninjatrader.com/support/help...ons.htm​

    Further, Rithmic uses separate feeds for Order/Execution/Position events and these events do NOT have a deterministic order in NinjaTrader. You will want to be mindful to handle these events separately and not rely on Order information in OnExectuionUpdate where you would want to handle stop and target submission.

    On this forum thread, you could find RithmicIBFriendly reference samples demonstrating how a NinjaScript strategy should be programmed to be used with Rithmic: https://forum.ninjatrader.com/forum/...72#post1206372
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by set2win, 08-04-2021, 09:23 AM
    39 responses
    999 views
    0 likes
    Last Post WaleeTheRobot  
    Started by md4866, Today, 08:15 PM
    0 responses
    1 view
    0 likes
    Last Post md4866
    by md4866
     
    Started by mjbatts91, Yesterday, 04:48 PM
    2 responses
    23 views
    0 likes
    Last Post mjbatts91  
    Started by pibrew, Today, 06:10 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by actualfacts.2021, 07-25-2021, 03:11 PM
    8 responses
    1,184 views
    0 likes
    Last Post linkcou
    by linkcou
     
    Working...
    X