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:	97
Size:	20.7 KB
ID:	1252786

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X