Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Long only strategy goes short

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

    Long only strategy goes short

    Hello everyone,

    I'm running a strategy with a long only market entry and exit long. But NT entered a short position. How is this possible?

    Code:
    // Set 1
    { EnterLong(Convert.ToInt32(DefaultQuantity), ""); }
    Code:
    // Set 2 { ExitLong(Convert.ToInt32(DefaultQuantity), "", ""); }
    Here's the log:
    9/13/2023 10:19:12 AM,Position,Instrument='ES 12-23' Account='APEX000XXXXXXX' Average price=0 Quantity=0 Market position=Flat Operation=Remove,
    9/13/2023 10:19:12 AM,Execution,Execution='19282470049_1' Instrument='ES 12-23' Account='APEX000XXXXXXX' Exchange=Default Price=4515 Quantity=1 Market position=Long Operation=Operation_Add Order='19282470049' Time='9/13/2023 10:19 AM',
    9/13/2023 10:19:12 AM,Order,Order='19282470049/APEX000XXXXXXX' Name='Close' New state='Filled' Instrument='ES 12-23' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=1 Fill price=4515 Error='No error' Native error='',
    9/13/2023 10:19:12 AM,Order,Order='19282470049/APEX000XXXXXXX' Name='Close' New state='Working' Instrument='ES 12-23' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error='',
    9/13/2023 10:19:12 AM,Order,Order='19282470049/APEX000XXXXXXX' Name='Close' New state='Accepted' Instrument='ES 12-23' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error='',
    9/13/2023 10:19:12 AM,Order,Order='19282470049/APEX000XXXXXXX' Name='Close' New state='Submitted' Instrument='ES 12-23' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error='',
    9/13/2023 10:19:12 AM,Strategy,Disabled strategy='rsiLongOnly/305976445',
    9/13/2023 10:19:12 AM,Default,Disabling NinjaScript strategy 'rsiLongOnly/305976445',
    9/13/2023 10:19:12 AM,Default,Chart Trader close position,
    9/13/2023 7:45:16 AM,Position,Instrument='ES 12-23' Account='APEX000XXXXXXX' Average price=4508.75 Quantity=1 Market position=Short Operation=Operation_Add,
    9/13/2023 7:45:16 AM,Execution,Execution='19282470043_1' Instrument='ES 12-23' Account='APEX000XXXXXXX' Exchange=Default Price=4508.75 Quantity=1 Market position=Short Operation=Operation_Add Order='19282470043' Time='9/13/2023 7:45 AM',
    9/13/2023 7:45:16 AM,Order,Order='19282470043/APEX000XXXXXXX' Name='Sell' New state='Filled' Instrument='ES 12-23' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=GTC Oco='' Filled=1 Fill price=4508.75 Error='No error' Native error='',
    9/13/2023 7:45:16 AM,Order,Order='19282470043/APEX000XXXXXXX' Name='Sell' New state='Working' Instrument='ES 12-23' Action='Sell' 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='',
    9/13/2023 7:45:16 AM,Order,Order='19282470043/APEX000XXXXXXX' Name='Sell' New state='Accepted' Instrument='ES 12-23' Action='Sell' 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='',
    9/13/2023 7:45:16 AM,Order,Order='19282470043/APEX000XXXXXXX' Name='Sell' New state='Submitted' Instrument='ES 12-23' Action='Sell' 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='',
    9/13/2023 7:45:16 AM,NinjaScript,NinjaScript strategy 'rsiLongOnly/305976445' submitting order,
    9/13/2023 12:48:16 AM,Connection,My NinjaTrader: Primary connection=Connected Price feed=Connected,
    9/13/2023 12:48:15 AM,Connection,My NinjaTrader: Primary connection=Connection lost Price feed=Connected,
    9/12/2023 11:59:02 PM,Position,Instrument='ES 12-23' Account='APEX000XXXXXXX' Average price=0 Quantity=0 Market position=Flat Operation=Remove,
    9/12/2023 11:59:02 PM,Execution,Execution='19282470028_1' Instrument='ES 12-23' Account='APEX000XXXXXXX' Exchange=Default Price=4513.25 Quantity=1 Market position=Short Operation=Operation_Add Order='19282470028' Time='9/12/2023 11:59 PM',
    9/12/2023 11:59:02 PM,Order,Order='19282470028/APEX000XXXXXXX' Name='' New state='Filled' Instrument='ES 12-23' Action='Sell' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=GTC Oco='' Filled=1 Fill price=0 Error='No error' Native error='',
    9/12/2023 10:30:35 PM,Position,Instrument='ES 12-23' Account='APEX000XXXXXXX' Average price=4510.75 Quantity=1 Market position=Long Operation=Operation_Add,
    9/12/2023 10:30:35 PM,Execution,Execution='19282470019_1' Instrument='ES 12-23' Account='APEX000XXXXXXX' Exchange=Default Price=4510.75 Quantity=1 Market position=Long Operation=Operation_Add Order='19282470019' Time='9/12/2023 10:30 PM',
    9/12/2023 10:30:35 PM,Order,Order='19282470019/APEX000XXXXXXX' Name='Buy' New state='Filled' Instrument='ES 12-23' Action='Buy' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=GTC Oco='' Filled=1 Fill price=4510.75 Error='No error' Native error='',
    9/12/2023 10:30:34 PM,Order,Order='19282470019/APEX000XXXXXXX' Name='Buy' New state='Working' Instrument='ES 12-23' Action='Buy' 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='',
    9/12/2023 10:30:34 PM,Order,Order='19282470019/APEX000XXXXXXX' Name='Buy' New state='Accepted' Instrument='ES 12-23' Action='Buy' 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='',
    9/12/2023 10:30:34 PM,Order,Order='19282470019/APEX000XXXXXXX' Name='Buy' New state='Submitted' Instrument='ES 12-23' Action='Buy' 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='',
    9/12/2023 10:30:34 PM,NinjaScript,NinjaScript strategy 'rsiLongOnly/305976445' submitting order,​


    #2
    Hello sawtooth,

    I see three order submittions.

    The first was a manually submitted order from Chart Trader by clicking the Close button.

    9/13/2023 10:19:12 AM,Default,Chart Trader close position,

    Which also disabled the strategy.

    9/13/2023 10:19:12 AM,Default,Disabling NinjaScript strategy 'rsiLongOnly/305976445',

    Which could have caused the position of the account to not be in sync with the strategy.

    The second was from a ninjascript, followed by a connection loss.

    9/13/2023 7:45:16 AM,NinjaScript,NinjaScript strategy 'rsiLongOnly/305976445' submitting order,

    The third is at the bottom and has no information after.

    9/12/2023 10:30:34 PM,NinjaScript,NinjaScript strategy 'rsiLongOnly/305976445' submitting order,​

    If you would like an order investigation, please send an email to support [at] ninjatrader [dot] com so that we may request your full log and trace files.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      thank you for your reply.
      Yes, I'd like an order investigation because I don't see any reason why this short trade was executed.

      Thank you

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      65 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      139 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X