Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

What are reasons when ChartTrader doesn't obtain the executed order's position

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

    What are reasons when ChartTrader doesn't obtain the executed order's position

    Most time, when strategy is running in live, ChartTrader obtains the positions correctly.
    However, once in a while there is occurence, when the strategy opens a position (i.e. reverse or from flat) but the ChartTrader doesn't show positions.
    Here is another example. It closed existing position and opened short position. However, CT didnt see this.



    What are the typical reasons which might explain such occasions?
    this has been happening in live. such things occur once in a while. In most cases, the trades are well synced by CT, but as above example (and sometimes) it has problems.

    #2
    Hello ttodua,

    Thank you for your post.

    Can you confirm this order was submitted while the strategy was running in real time? I note it looks as though the strategy is not currently active at the time of the screenshot -- I'm not seeing the lines that usually connect strategy orders, and I note the chart has been scrolled back from the current bar.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Is not on screenshot visible, there is green line, which connects to the "Close" arrow. and yes, i confirm, it was realtime. So, how one might note that strategy was not active? unfortunately I cant say 100% sure if strategy was active or not by the time of screenshot
      So, you might suspect some possible error which causes strategy to shut down? but i am sure it was working and was not shut down.

      for everything that happened during 12:30 and 12:55:
      here trace : [redacted]
      here log : [redacted]

      my doubts lean to the fact, that in logs there is not "close position" one, which should be generally when strategy reverses position...
      Last edited by NinjaTrader_Kate; 10-16-2020, 07:50 AM. Reason: Removed log and trace links as those may contain personally identifiable information

      Comment


        #4
        Hello ttodua,

        Thank you for your reply.

        You've started the strategy with an existing position on the account. When the strategy started running, the first thing it did was calculate it should have had a position in the opposite direction of the existing position, which it submitted, leaving your strategy position out of sync with the account position and resulting in the odd lack of lines you saw.

        We can see this from the log here:
        2020-10-15 12:37:24:619|1|4|Enabling NinjaScript strategy 'Amin_Education/206518196' : On starting a real-time strategy - StartBehavior=WaitUntilFlat Position=ES 12-20 1L, ES 12-20 1L AccountPosition=ES 12-20 1L EntryHandling=All entries EntriesPerDirection=1 StopTargetHandling=Per entry execution ErrorHandling=Stop strategy, cancel orders, close positions ExitOnSessionClose=False SetOrderQuantityBy=Strategy ConnectionLossHandling=Recalculate DisconnectDelaySeconds=10 CancelEntriesOnStrategyDisable=False CancelExitsOnStrategyDisable=False Calculate=On each tick IsUnmanaged=False MaxRestarts=4 in 5 minutes
        2020-10-15 12:47:55:429|1|4|NinjaScript strategy 'Amin_Education/206518196' submitting order
        2020-10-15 12:47:55:480|1|32|Order='772ad0937e2842a58fd599ac5 f1bc702/Sim101' Name='S' New state='Submitted' Instrument='ES 12-20' Action='Sell short' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
        2020-10-15 12:47:55:587|1|32|Order='772ad0937e2842a58fd599ac5 f1bc702/Sim101' Name='S' New state='Accepted' Instrument='ES 12-20' Action='Sell short' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
        2020-10-15 12:47:55:588|1|32|Order='772ad0937e2842a58fd599ac5 f1bc702/Sim101' Name='S' New state='Working' Instrument='ES 12-20' Action='Sell short' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error=''
        2020-10-15 12:47:55:626|1|32|Order='772ad0937e2842a58fd599ac5 f1bc702/Sim101' Name='S' New state='Filled' Instrument='ES 12-20' Action='Sell short' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=GTC Oco='' Filled=1 Fill price=3474 Error='No error' Native error=''
        2020-10-15 12:47:55:626|1|8|Execution='b795dba6213a43f199468a 2b4d09cf0f' Instrument='ES 12-20' Account='Sim101' Exchange=Default Price=3474 Quantity=1 Market position=Short Operation=Operation_Add Order='772ad0937e2842a58fd599ac5f1bc702' Time='10/15/2020 12:47 PM'
        2020-10-15 12:47:55:627|1|64|Instrument='ES 12-20' Account='Sim101' Average price=0 Quantity=0 Market position=Flat Operation=Remove
        2020-10-15 13:32:20:161|3|2|Connection lost to the NinjaTrader Information Server: is-us-nt-005.ninjatrader.com

        This is occurring because you are using Wait Until Flat as your Start Behavior when there was an existing position on the acccount, which does not submit a synchronization order to sync your account position to the strategy position. I would suggest, if you have an existing position on an instrument, that you use Wait Until Flat, Synchronize Account instead.



        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by alifarahani, Today, 09:40 AM
        2 responses
        11 views
        0 likes
        Last Post alifarahani  
        Started by junkone, Today, 11:37 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by pickmyonlineclass, Today, 12:23 PM
        0 responses
        1 view
        0 likes
        Last Post pickmyonlineclass  
        Started by frankthearm, Yesterday, 09:08 AM
        12 responses
        44 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by quantismo, 04-17-2024, 05:13 PM
        5 responses
        35 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X