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

New Indicator

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

    New Indicator

    how can I access the current price of an instrument like "6E" and plot it in a new panel on a chart with a different instrument from a script or indicator? Thanks

    #2
    Try using the help page and search OnMarketData() method, you can store and check last price bid and ask in that method and then do things when you have the price. Although you can get it fast using GetCurretnAsk(0) or GetCurrentBid(0) and use your logic on what the most recent price of those values.

    Comment


      #3
      Hello SQuant,

      Thanks for your post.

      Will the indicator be running on the 6E instrument?

      If so, you could add a plot to the indicator using the AddPlot() method and assign the price you want to the plot, such as Close[0] to assign the plot the Close price.

      To have the indicator plot on a separate panel, make sure to set the IsOverlay property to false.

      See the help guide documentation below for more information and sample code.

      AddPlot(): https://ninjatrader.com/support/help...t8/addplot.htm
      Close: https://ninjatrader.com/support/help.../nt8/close.htm
      PriceSeries: https://ninjatrader.com/support/help...riceseries.htm
      IsOverlay: https://ninjatrader.com/support/help...tsub=isoverlay

      Below is a link to a forum post with helpful information about getting started with NinjaScript.
      https://ninjatrader.com/support/foru...040#post786040

      Here is a link to our publicly available training video, 'NinjaScript Editor 401', for you to view at your own convenience.
      NinjaScript Editor 401 - https://youtu.be/H7aDpWoWUQs?list=PL...We0Nf&index=14

      Please let me know if I may assist further.​
      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AaronKoRn, Today, 09:49 PM
      0 responses
      11 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Today, 08:42 PM
      0 responses
      10 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Today, 07:51 PM
      0 responses
      11 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,980 views
      3 likes
      Last Post jhudas88  
      Started by rbeckmann05, Today, 06:48 PM
      0 responses
      9 views
      0 likes
      Last Post rbeckmann05  
      Working...
      X