Announcement

Collapse
No announcement yet.

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(Typical, Period)[0];
                  double offset    = SMA(diff, Period)[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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        563 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        329 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        548 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X