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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      77 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X