Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

HELP: EnterLong keeps causing "Unhandled Exception"

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

    HELP: EnterLong keeps causing "Unhandled Exception"

    Hello,

    This used to be an intermittent issue, starts with the Chart screen disappearing the mouse pointer (i.e. no crosshairs at all), This happens after a Strategy Entry (submit order). I can right click on it, but anything after that freezes.

    I typically use close NT, and then the Unhandles Exception dialog box shows up. I then have to use Task Manager to End Task NT.

    I'd appreciate help in debugging this issue. It doesn't seem that my code is doing this as the dialog appears when the chart disappears along with my strategy.

    Debugging using Visual Studio doesn't yield an error break (attached to NinjaTrader.exe).

    NT version 8.1.1.6 64-bit

    Code:
    Long Entry:
    
                                if (Limit_1_Market_2 == 1)
                                {
                                    PrintLog(1, "Strategy: Submitting Long Limit Order " + Close[0].ToString(format) + " Qty: " + ContractQuantity);
                                    EnterLongLimit(ContractQuantity, Close[0], "EnterLongLimit");
                                }
                                else
                                {
                                    PrintLog(1, "Strategy: Submitting Long Market Order" + " Qty: " + ContractQuantity );
                                    EnterLong(ContractQuantity, "EnterLongMarket");
                                }
    
                                if (ReEntryEnabled && ReEntryCount == 0)
                                {
                                    ReEntryCount = ReEntryCount + 1;
                                } else if (ReEntryEnabled && ReEntryCount > 0 && ReEntryCount < ReEntryMax)
                                {
                                    ReEntryCount = ReEntryCount + 1;
                                    PrintLog( 1, "         Long ReEntry");
                                }​
    Code:
    Short Entry
    
                                if((TradingDay[0] && ShowOtherPlots))
                                    Trigger[0] = Low[0] - SecondaryPlotGap * 8 - SecondaryPlotOffset - PrimaryPlotOffset;
                                PrintLog( 3, "In submission 5");
                                ClearToSubmit = false;
                                if (Limit_1_Market_2 == 1)
                                {
                                    PrintLog(1, "Strategy: Submitting Short Limit Order " + Close[0].ToString(format) + " Qty: " + ContractQuantity );
                                    EnterShortLimit(ContractQuantity, Close[0], "EnterShortLimit");
                                }
                                else
                                {
                                    PrintLog(1, "Strategy: Submitting Short Market Order" + " Qty: " + ContractQuantity );
                                    EnterShort(ContractQuantity, "EnterShortMarket");
                                }
    
                                if (ReEntryEnabled && ReEntryCount == 0)
                                {
                                    ReEntryCount = ReEntryCount + 1;
                                } else if (ReEntryEnabled && ReEntryCount > 0 && ReEntryCount < ReEntryMax)
                                {
                                    ReEntryCount = ReEntryCount + 1;
                                    PrintLog( 1, "         Short ReEntry");
                                }​
    Many Thanks, Caesar.
    Last edited by Skechers; 05-24-2023, 09:16 AM.

    #2
    Hello, thanks for writing in. This does not happen on a NinjaTrader installation that has no custom code installed or running, so any addon or scripts you are running are causing this to happen. Please write into scriptingsupport at ninjatrader.com and send me your log and trace files so I can have a look at what may be causing this:

    Please follow the steps below to manually attach your log and trace files to your email (do not post these to the forum):
    • Open the Windows File Explorer (hotkey = Windows key + E) Then navigate to, "Documents" > 'NinjaTrader 8' folder
    • Right-click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
    • Send the 2 compressed folders as attachments to this email.
    • Once complete, you can delete these compressed folders.

    Comment


      #3
      Forgot the dialog box.

      Click image for larger version

Name:	Capture.jpg
Views:	91
Size:	20.7 KB
ID:	1252786

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      75 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      146 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
      50 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      54 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X