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 ScottW, Today, 06:09 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by ScottWalsh, Today, 06:52 PM
        0 responses
        4 views
        0 likes
        Last Post ScottWalsh  
        Started by ftsc2022, 10-25-2022, 12:03 PM
        5 responses
        256 views
        0 likes
        Last Post KeyonMatthews  
        Started by Board game geek, 10-29-2023, 12:00 PM
        14 responses
        244 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Waxavi, 04-19-2024, 02:10 AM
        4 responses
        56 views
        0 likes
        Last Post sonia0101  
        Working...
        X