• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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(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 rickyblah12, Today, 01:01 PM
        0 responses
        8 views
        0 likes
        Last Post rickyblah12  
        Started by dadarara, Today, 12:18 PM
        0 responses
        8 views
        0 likes
        Last Post dadarara  
        Started by joemiller, Today, 07:33 AM
        2 responses
        12 views
        0 likes
        Last Post joemiller  
        Started by TheGameOfProbabilities, 07-18-2019, 06:56 AM
        7 responses
        38 views
        0 likes
        Last Post DaveS
        by DaveS
         
        Started by claxxical, Yesterday, 10:00 PM
        0 responses
        13 views
        0 likes
        Last Post claxxical  
        Working...
        X