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 BarzTrading, Today, 07:25 AM
        1 response
        9 views
        1 like
        Last Post NinjaTrader_Clayton  
        Started by EB Worx, 04-04-2023, 02:34 AM
        7 responses
        161 views
        0 likes
        Last Post VFI26
        by VFI26
         
        Started by Mizzouman1, Today, 07:35 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Radano, 06-10-2021, 01:40 AM
        20 responses
        616 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by i019945nj, 12-14-2023, 06:41 AM
        6 responses
        69 views
        0 likes
        Last Post i019945nj  
        Working...
        X