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

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
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thank you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ryan_21, Yesterday, 08:46 PM
      2 responses
      6 views
      0 likes
      Last Post ryan_21
      by ryan_21
       
      Started by Salahinho99, 05-05-2024, 04:13 AM
      8 responses
      65 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Seneca, 08-25-2020, 08:31 AM
      3 responses
      5,946 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Tradereh2020, Today, 06:29 AM
      0 responses
      9 views
      0 likes
      Last Post Tradereh2020  
      Started by slightly, Today, 12:49 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Working...
      X