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 cmtjoancolmenero, Yesterday, 03:58 PM
      9 responses
      35 views
      0 likes
      Last Post cmtjoancolmenero  
      Started by DayTradingDEMON, Today, 09:28 AM
      4 responses
      23 views
      0 likes
      Last Post DayTradingDEMON  
      Started by geddyisodin, Yesterday, 05:20 AM
      9 responses
      50 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by George21, Today, 10:07 AM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by Stanfillirenfro, Today, 07:23 AM
      9 responses
      24 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X