Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with Order Execution

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

    Problem with Order Execution

    Hello,

    there were execution problems in the strategy at a customer whose log entries are unclear.
    The strategy orders with EnterShortStopMarket(1, true, Lots, shortEntryLevel, "SE") and ExitShortStopMarket(1, true, Lots, shortExitLevel, "SX", "SE");
    How to interpret the log when it says :

    07/06/2023 16:01 NinjaScript NinjaScript strategy 'A - 15:30-15:59 70:40:54:75 6 contracts/247348185' sends order.
    and

    07/06/2023 16:01 NinjaScript NinjaScript strategy 'B - NQ Short 4/247348113' sends order.
    Were there two strategies running here?




    Click image for larger version  Name:	problem_orderexecution.png Views:	0 Size:	136.4 KB ID:	1259347

    Thank you.​
    Last edited by signalworks; 07-07-2023, 03:03 AM.

    #2
    Hello signalworks,

    Logs can contain sensitive information, such as account numbers. Moving forward, should have inquiries that are scripting related and the log needs to be provided, please send an email to scriptingsupport [at] ninjatrader [dot] com.

    That said, I am only seeing 1 order submitted in this log from strategy STRAT01 with instance ID 247348185.

    2023-07-06 21:54 Standard strategy 'STRAT01/247348185' submitted an order that generated the following error 'Order rejected'. Strategy sent deletion requests, tried to close the position and ended itself.
    2023-07-06 21:54 Default Disable NinjaScript strategy 'STRAT01/247348185'​

    The error is from the brokerage
    Native error='This account is only allowed to liquidate open positions'

    I would contact the brokerage and inquire why the account is not able to open new positions.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea! I wrote to scriptingsupport.

      One more question about something I noticed in the log file:

      Since the position was closed manually by the client, the account was flat, however, just before the close of the trade, the strategy still ran the logic of the strategy "to close a position at certain time" and wrote an error message to the log.
      The market position of the strategy was obviously not FLAT, because for this logic execution the market position is queried in the code

      How can be taken into account in the code when manual intervention occurs? Strategy position vs account position. I didn't find this scenario in the help, only ones that take effect when a strategy is started.

      Thanks a lot!​
      Last edited by signalworks; 07-10-2023, 12:01 AM.

      Comment


        #4
        Hello signalworks,

        Manual orders do not affect the strategy position or order methods. You would need the strategy to place the order to change the strategies position.
        You could do this through a button click.
        I need some guidance. I need to create a script that has 3 plots that are public and they plot either a 1 or 0. But I need to create another indicator that has 3 chart buttons that sets these variables. The first indicator needs to get those values from the second indicator depending on the button clicks. Because of using
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        81 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        150 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        79 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        52 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        59 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X