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 rhyminkevin, Today, 04:58 PM
      3 responses
      48 views
      0 likes
      Last Post Anfedport  
      Started by iceman2018, Today, 05:07 PM
      0 responses
      5 views
      0 likes
      Last Post iceman2018  
      Started by lightsun47, Today, 03:51 PM
      0 responses
      7 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      14 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      50 views
      0 likes
      Last Post futtrader  
      Working...
      X