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

Deleting Unexecuted Stop Orders

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

    #16
    Hello mr1997,

    I do not see such an error when I test. I suggest first to redownload the script I have attached and perform the modifications just as I have in the video below.

    Demo - https://drive.google.com/file/d/144c...w?usp=drivesdk

    I may then suggest using a diff tool to compare your modifications to what I have posted, noting that you have added the CurrentBar check, removed the State.Historical check, and also commented out the Account.Flatten code that was given for testing. If the issue comes about from other code modifications, you will want to take debugging steps to understand how your modifications hit this error.

    A publicly available diff utility is linked below.

    Diffchecker will compare text to find the difference between two text files. Just paste your files and click Find Difference!


    This error would be seen if an object is null at the time it is being referenced. The solution would be to protect that code with a null check, or if the object should not be null, to track down when the object is set to null and when the object is assigned. Tracking down how the object is set to null and assigned can help to identify if an assignment was missed, or if the order object was set to null unintentionally.

    Debugging Tips - https://ninjatrader.com/support/help...script_cod.htm

    Checking for null references - https://ninjatrader.com/support/help...references.htm

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by geddyisodin, Today, 05:20 AM
    4 responses
    28 views
    0 likes
    Last Post geddyisodin  
    Started by geotrades1, Today, 10:02 AM
    2 responses
    5 views
    0 likes
    Last Post geotrades1  
    Started by ender_wiggum, Today, 09:50 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by rajendrasubedi2023, Today, 09:50 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by bmartz, Today, 09:30 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X