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

Open external file

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

    Open external file

    I have in a Ninjatrader indicator the following:

    PHP Code:
    #region Using declarations
    using System;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.ComponentModel;
    using System.Xml.Serialization;
    using NinjaTrader.Data;
    using NinjaTrader.Gui.Chart;
    #endregion

    protected override void OnBarUpdate()
            {
    Process.Start("C:\test.exe");
                } 
    But the test.exe doesn't start when loading the indicator into a chart. The chart doesn't load the indicator at all.. Do I something miss?

    Thx!
    Last edited by no111; 09-03-2015, 12:18 PM.

    #2
    Hello no111,

    This script does not have the Initialize() method in it and likely will not run. This indicator is also not part of the Indicator namespace and would not have access to methods for the indicator.

    I cannot comment on using Process.Start() as this is not supported by NinjaTrader Support to use.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      The other code:

      PHP Code:
          protected override void Initialize()
              {
                  
      Add(new Plot(Color.DarkGray"Midline"));
                  
      Add(new Plot(Color.DarkGray,     "Upper"));
                  
      Add(new Plot(Color.DarkGray,     "Lower"));

                  
      diff                = new DataSeries(this);

                  
      Overlay                true;
                  
                  
              }

              
      /// <summary>
              /// Called on each bar update event (incoming tick).
              /// </summary>
              
      protected override void OnBarUpdate()
              {
                  
      diff.Set(High[0] - Low[0]);

                  
      double middle    SMA(TypicalPeriod)[0];
                  
      double offset    SMA(diffPeriod)[0] * offsetMultiplier;

                  
      double upper    middle offset;
                  
      double lower    middle offset;

                  
      Midline.Set(middle);
                  
      Upper.Set(upper);
                  
      Lower.Set(lower);
                   
                  
      //    if ( Close[0] != Close[1])
                  //{
                  //}

                  
      Process.Start("C:\test.exe");
                  } 
      Hmm okay, do you know a workaround to load this exe file? or word file?

      Comment


        #4
        Hello no111,

        Starting a process outside of NinjaTrader is not supported by NinjaTrader to do.

        However, this thread will remain open for any community members that would like to assist.


        However, you mention that the indicator will load on a chart.

        Are you getting error messages in the Log tab of the Control Center?

        If so, these may have stopped the script. What do these errors say?

        If you add a print to the first line of OnBarUpdate() do you see the print appear in the output window?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by nandhumca, Today, 03:41 PM
        0 responses
        4 views
        0 likes
        Last Post nandhumca  
        Started by The_Sec, Today, 03:37 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Started by GwFutures1988, Today, 02:48 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        6 responses
        33 views
        0 likes
        Last Post ScottWalsh  
        Started by frankthearm, Today, 09:08 AM
        10 responses
        36 views
        0 likes
        Last Post frankthearm  
        Working...
        X