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

Limit orders are filled twice on FXCM live account

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

    Limit orders are filled twice on FXCM live account

    I have a complex unmanaged strategy, which I'm developing for some time. It works on limit orders. It was tested on SIM account for several months and all was working well. But the moment it is switched to FXCM live account, then every limit order is being filled twice, which ends up with NinjaTrader crash.
    I have a second similar strategy, which places market orders and there is no problem with it. They both share the same order processing logic. Only limit orders are affected.
    I've extracted an example of such behavior for a single transakction from trace and log files and documented individual steps, but I'm unable to figure out, what is causing the problem.
    Would you be so kind to take a look on trace and log file I've prepared? Could I send them to you by e-mail? Maybe you would be able to come up with an idea, that would allow to troubleshoot the issue.

    #2
    Hello InteRadek,

    Thank you for writing in.

    Could you please send an email to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and attach the log and trace files for the day in subject which you can find in My Documents>NinjaTrader8>Log and My Documents>NinjaTrader8/Trace folders.

    I look forward to your email.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello Alan,
      Thank you for your time. After investigetion I've found the root cause of the problem. It turns out, that a Live account generates 2 'filled' signals for every fill, when a SIM account generates only 1 signal. For example SIM account doesn't generate Sell short order with Limit price=0 and Buy to cover signal with Stop price=0. Strategy logic wasn't prepared for such situation.
      Limit
      2018-02-04 23:04:36:786|1|32|Order='111111111/XXXXXXXXXX' Name='Short Limit' New state='Filled' Instrument='USDJPY' Action='Sell short' Limit price=0 Stop price=110.157 Quantity=2 000 Type='Limit' Time in force=DAY Oco='' Filled=2000 Fill price=110.198 Error='No error' Native error=''
      2018-02-04 23:04:36:911|1|32|Order='111111111/XXXXXXXXXX' Name='Short Limit' New state='Filled' Instrument='USDJPY' Action='Sell short' Limit price=110.157 Stop price=0 Quantity=2 000 Type='Limit' Time in force=DAY Oco='' Filled=2000 Fill price=110.198 Error='No error' Native error=''
      Stop Market
      2018-02-05 09:39:38:543|1|32|Order='222222222/XXXXXXXXXX' Name='Stop Loss' New state='Filled' Instrument='GBPJPY' Action='Buy to cover' Limit price=155.201 Stop price=0 Quantity=2 000 Type='Stop Market' Time in force=GTC Oco='d6d3a2198f2947e8af8658b5bb4e752f' Filled=2000 Fill price=155.199 Error='No error' Native error=''
      2018-02-05 09:39:38:544|1|32|Order='222222222/XXXXXXXXXX' Name='Stop Loss' New state='Filled' Instrument='GBPJPY' Action='Buy to cover' Limit price=0 Stop price=155.201 Quantity=2 000 Type='Stop Market' Time in force=GTC Oco='d6d3a2198f2947e8af8658b5bb4e752f' Filled=2000 Fill price=155.199 Error='No error' Native error=''
      So I'd done additional coding to filter those signals and now all is working fine.
      Code:
      [B]Example for a limit order:[/B]
      if (order.IsLimit && order.LimitPrice == 0)
          return;

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by thanajo, 05-04-2021, 02:11 AM
      4 responses
      470 views
      0 likes
      Last Post tradingnasdaqprueba  
      Started by aa731, Today, 02:54 AM
      0 responses
      4 views
      0 likes
      Last Post aa731
      by aa731
       
      Started by Christopher_R, Today, 12:29 AM
      0 responses
      10 views
      0 likes
      Last Post Christopher_R  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      166 responses
      2,237 views
      0 likes
      Last Post sidlercom80  
      Started by thread, Yesterday, 11:58 PM
      0 responses
      6 views
      0 likes
      Last Post thread
      by thread
       
      Working...
      X