Announcement

Collapse
No announcement yet.

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:
      Example for a limit order:
      if (order.IsLimit && order.LimitPrice == 0)
          return;

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by moehsan, Yesterday, 09:47 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by BraisedInBlue, Today, 06:43 AM
      0 responses
      5 views
      0 likes
      Last Post BraisedInBlue  
      Started by AaronKoRn, Today, 06:28 AM
      0 responses
      3 views
      0 likes
      Last Post AaronKoRn  
      Started by pjsmith, Today, 01:00 AM
      1 response
      13 views
      0 likes
      Last Post NT-Roland  
      Started by alejandro888, Yesterday, 08:41 PM
      0 responses
      9 views
      0 likes
      Last Post alejandro888  
      Working...
      X