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

MessageBox causing NT CTD

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

    MessageBox causing NT CTD

    if(!feWarn && finalExitMode == "TRO" && (TDirection == "L" ? (TRO(tROPeriods)[0] < TRO(tROPeriods)[1] && TRO(tROPeriods)[1] > TRO(tROPeriods)[2]) : (TRO(tROPeriods)[0] > TRO(tROPeriods)[1] && TRO(tROPeriods)[1] < TRO(tROPeriods)[2])))
    {
    MessageBox.Show("A TRO HOOK may be imminent.",
    "TRO Hook",
    MessageBoxButtons.OK,
    MessageBoxIcon.Information);
    feWarn = true;
    }
    else if(!feWarn && finalExitMode == "CCI" && (TDirection == "L" ? (CCI(cCIPeriods)[0] < lineValue && CCI(cCIPeriods)[1] > lineValue) : (CCI(cCIPeriods)[0] > -lineValue && CCI(cCIPeriods)[1] < -lineValue)))
    {
    MessageBox.Show("A CCI LINE CROSS may be imminent.",
    "CCI Line Cross",
    MessageBoxButtons.OK,
    MessageBoxIcon.Information);
    feWarn = true;
    }

    I have the above code in an indicator to alert when a tracked trade is becoming precarious. feWarn is set to false in [Variables] and reset to false in EndTrade() (not shown) which is called when a trade goes flat.

    using System.Windows.Forms;
    is set in [declarations].

    For whatever reason, the message box appears multiple times (still scratching head on that one), and NT crashes to the desktop w/o warning. The Trace file shows nothing and the the log tab, of course, is reset.
    Attached Files

    #2
    Hi Snaphook,

    Unfortunately using message boxes and System.Windows.Forms is not supported. You can use them, but will have to track down on your own the cause of any error messages, crashes, or issues. Hopefully another community member with experience using message boxes can assist here.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I hope someone can tell me what is wrong with the code, but the other reason for posting this was to alert you to the fact that it is causing a full blown, fatal, and immediate crash to the desktop of NT, w/o the "NT has detected a problem..." dialog, not a good thing.

      Comment


        #4
        Thanks snaphook, however we could unfortunately not debug this code as using it falls out of our supported boundaries as Ryan mentioned.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Radano, 06-10-2021, 01:40 AM
        19 responses
        605 views
        0 likes
        Last Post Radano
        by Radano
         
        Started by KenneGaray, Today, 03:48 AM
        0 responses
        4 views
        0 likes
        Last Post KenneGaray  
        Started by thanajo, 05-04-2021, 02:11 AM
        4 responses
        470 views
        0 likes
        Last Post tradingnasdaqprueba  
        Started by aa731, Today, 02:54 AM
        0 responses
        5 views
        0 likes
        Last Post aa731
        by aa731
         
        Started by Christopher_R, Today, 12:29 AM
        0 responses
        11 views
        0 likes
        Last Post Christopher_R  
        Working...
        X