Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PendingSubmit orders and couple of scripting issues

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

    PendingSubmit orders and couple of scripting issues

    1.I have two orders in PendingSubmit state. It's been around for a few days. Even after closing and restarting NT, the orders are still there. Please let me know how I could get rid of these, it slows down the process of bringing up data on the chart. (This is on NT Sim).

    2.double entryPoint

    I need to define a condition within my script that checks for:
    if GetCurrentBid() “touches” entryPoint......//then do something

    Is there any operator available to check for the above condition, other than
    ( if GetCurrentBid() == entryPoint ) ? I'm just concerned that if the market is moving too fast, then the == operator may not work.

    3. Sometimes I need to Cancel an order and reuse the IOrder object as given below:
    Code:
    entryOrder = EnterLongStop(0, true, quantity, upperValue, "");
    		
    if ( (GetCurrentBid() - lowerValue) < 0.001 )
    {
    	CancelOrder(entryOrder);
    	entryOrder = null;
    	entryOrder = EnterShortStop(0, true, quantity, lowerValue, "");
    }
    Does the API provide for a more efficient way to do the above. I'm just concerned that if the order is not cancelled for some reason, then what would happen to my null assignment followed by EnterShortStop to the entryOrder object.

    Thanks so much for the help.

    Joe

    #2
    Hi JoeStein,

    1. Please go to Tools > Options > Simulator > Misc and Reset the Simulator. Then the 'stuck' order should disappear.

    2. Not sure I follow, if you fear you miss the entry point just use the script on CalculateOnBarClose = false - http://www.ninjatrader-support.com/H...BarClose1.html

    3. Just check the OrderState for a cancel confirmation before reusing it - http://www.ninjatrader-support.com/H...V6/IOrder.html

    Comment


      #3
      Thank you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X