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

**NT** Error on triggering custom event for strategy Specified method is not supporte

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

    **NT** Error on triggering custom event for strategy Specified method is not supporte

    I am getting this error sometimes when running the strategy in Reply Mode.

    What is the actual method that is not supported? How can I get more details about this error?

    #2
    Hi Alex.nt,

    The error is point to a custom method that is being triggered in the code.

    Can you provide the code that you are using for the TriggerCustomEvent()?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      private void CheckStopTimerEventHandler(object sender, System.Timers.ElapsedEventArgs e)
      {
      if (!System.Threading.Monitor.TryEnter(m_stopLock))
      {
      return;
      }
      try
      {
      Parent.TriggerCustomEvent(UpdateStopTimer, 0, null);
      }
      catch (Exception ex)
      {
      Parent.Print(ex.Message);
      Parent.Print(ex.StackTrace);
      }
      finally
      {
      System.Threading.Monitor.Exit(m_stopLock);
      }
      }


      Note that this method is called by System.Timers.Timer once per 1 second

      Comment


        #4
        Hello alex.nt,

        The try and catch does appear to be OK.

        The issue may be in the UpdateStopTimer method.

        May I have a reduced version of your script with only the code necessary to reproduce this error?

        To export your script do the following:
        1. Click File -> Utilities -> Export NinjaScript
        2. Enter a unique name for the file in the value for 'File name:'
        3. Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
        4. Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message


        By default your exported file will be in the following location:
        • (My) Documents/NinjaTrader 7/bin/Custom/ExportNinjaScript/<export_file_name.zip>



        Below is a link to the help guide on Exporting NinjaScripts.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you for the reply. The problem is that the error is not 100% reproducible. Now I cannot trigger it.

          Let me watch it for a while. If it starts to re-appear I will send you the strategy to troubleshoot.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by pibrew, Today, 06:37 AM
          0 responses
          0 views
          0 likes
          Last Post pibrew
          by pibrew
           
          Started by rbeckmann05, Yesterday, 06:48 PM
          1 response
          12 views
          0 likes
          Last Post bltdavid  
          Started by llanqui, Today, 03:53 AM
          0 responses
          6 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by burtoninlondon, Today, 12:38 AM
          0 responses
          10 views
          0 likes
          Last Post burtoninlondon  
          Started by AaronKoRn, Yesterday, 09:49 PM
          0 responses
          15 views
          0 likes
          Last Post AaronKoRn  
          Working...
          X