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 Barry Milan, Today, 10:35 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by WeyldFalcon, 12-10-2020, 06:48 PM
      14 responses
      1,427 views
      0 likes
      Last Post Handclap0241  
      Started by DJ888, Yesterday, 06:09 PM
      2 responses
      9 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by jeronymite, 04-12-2024, 04:26 PM
      3 responses
      40 views
      0 likes
      Last Post jeronymite  
      Started by bill2023, Today, 08:51 AM
      2 responses
      16 views
      0 likes
      Last Post bill2023  
      Working...
      X