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

How to reference the name of a chart in a script file?

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

    How to reference the name of a chart in a script file?

    Hi - new to scripting under Ninja. I'm setting up some alerts and as part of the output to the alert window, I'd like to display the name of the chart window. This is what's in the title bar. Details:

    * Multiple same symbol charts; say, AAPL 15 Min chart, AAPL 30 Min chart, AAPL 60 Min chart, etc.
    * When an alert fires off, I want the message to include the name of the specific chart, so I know exactly where it came from.
    * I'll be experimenting some with the print command and the output window, so might wanna issue a print statement with the chart name there, too.
    * It's possible I might want to pass the chart name and some message info to some routines outside of Ninja, but for now, I'm starting with the alert window and output window.

    Anyone have a specific reference variable to use and a sample one-liner showing syntax?

    Thanks.

    #2
    Hello AMATX,

    Thanks for your post.

    Here are some reference to the helpguide on variations of instrument:
    http://ninjatrader.com/support/helpG...instrument.htm
    http://ninjatrader.com/support/helpG...t_fullname.htm

    Here is a reference to BarsPeriod to define the bartype and period of the data:
    http://ninjatrader.com/support/helpG...barsperiod.htm

    Here is an example of an alert statement that produces a message to identify the chart:

    Alert("myAlert3", NinjaTrader.Cbi.Priority.Medium,"CS3: Candle touch UP on: "+Instrument.MasterInstrument.Name+""+BarsPeriod.V alue.ToString() +" "+ BarsPeriod.Id.ToString()+" Chart. Price= "+Close[0]+" Ang= "+iEMA,"Chime-2.wav", rearm, Color.Aquamarine, Color.Black) ;

    Attached is the example output.
    Attached Files
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks. Will try later this week or on weekend.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by corman, Today, 02:02 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Uregon, Today, 12:12 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by kerplunk1899, Today, 10:03 AM
      1 response
      19 views
      0 likes
      Last Post NinjaTrader_Kate  
      Started by rexsole, Today, 10:20 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_RyanS  
      Started by pjsmith, Today, 03:01 AM
      6 responses
      18 views
      0 likes
      Last Post bltdavid  
      Working...
      X