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 llanqui, Yesterday, 09:59 AM
        2 responses
        15 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by ThoriSten, Today, 03:56 AM
        0 responses
        2 views
        0 likes
        Last Post ThoriSten  
        Started by PhillT, 04-19-2024, 02:16 PM
        3 responses
        18 views
        0 likes
        Last Post mangel2000  
        Started by TraderBCL, Today, 02:37 AM
        0 responses
        1 view
        0 likes
        Last Post TraderBCL  
        Started by mangel2000, Today, 02:23 AM
        0 responses
        9 views
        0 likes
        Last Post mangel2000  
        Working...
        X