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 can I add mid point line?

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

    How can I add mid point line?

    Hi I am trying to add mid point line to this indicator - prior day OHLC. I want to add (H+L)/2. Could you help me with how to do it? or if you already have it, could you let me know?


    #2
    Hello kimbbi1235,

    Thanks for your post.

    To modify the PriorDayOHLC indicator, you would first make a copy of the script. To do so, open a New > NinjaScript Editor window, open the indicators folder, choose the PriorDayOHLC script, right click in the PriorDayOHLC script, select 'Save as', name the copy of the script, and click OK.

    After creating a copy of the script, you would use the AddPlot() method with a stroke parameter to add another plot to the script. See the syntax below. Then, you would assign a value to the plot such as (High[0] - Low[0]) / 2.

    AddPlot(Stroke stroke, PlotStyle plotStyle, string name)

    See the PriorDayOHLC script in the NinjaScript Editor which demonstrates this.

    Also, see this help guide for more information and examples of using AddPlot(): https://ninjatrader.com/support/help...ml?addplot.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello kimbbi1235,

      Thanks for your post.

      To modify the PriorDayOHLC indicator, you would first make a copy of the script. To do so, select Tools > Edit NinjaScript > Indicator, select the PriorDayOHLC indicator, right-click in the indicator's code, select 'Save as', name the copy of the script, and click OK.

      After creating a copy of the script, you would use the Add() method to add another plot to the script. Then, in OnBarUpdate() you would assign a value to the plot using <Plot name>.Set() or Values[].Set(). For example, if we have a plot named MyPlot, we would use MyPlot.Set((High[0] - Low[0]) / 2).

      See the PriorDayOHLC script that comes default with NinjaTrader which demonstrates this.

      Also, see the help guide documentation below for more information and examples.

      Add(): https://ninjatrader.com/support/helpGuides/nt7/add.htm
      Value: https://ninjatrader.com/support/help.../nt7/value.htm

      Let us know if we may assist further.
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Hi Thanks for your reply but I am struggling to add this? I am not very familiar with coding so I am a little lost here. Can you please give me a little more details about this?

        Comment


          #5
          Hello kimbbi1235,

          Thanks for your note.

          As mentioned in my previous email, you would first create a copy of the PriorDayOHLC indicator. After making a copy of the indicator, you could modify it to include another plot.

          The Add() method would be used to add another plot to the copy of the script. You would then need to assign a value for the plot in the OnBarUpdate() method of the script by calling <PlotName>.Set().

          The PriorDayOHLC indicator that comes with NinjaTrader demonstrates adding plots and assigning a value to those plots. See the PriorDayOHLC indicator script for example code. You could view the code by selecting Tools > Edit NinjaScript > Indicator, and selecting the PriorDayOHLC indicator.

          You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. If you would like our NinjaTrader Ecosystem team follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request, please contact vendorsupport[AT]ninjatrader.com.

          Let us know if we may assist further.
          Brandon H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by stafe, Today, 12:34 PM
          2 responses
          20 views
          0 likes
          Last Post stafe
          by stafe
           
          Started by asmmbillah, Today, 11:18 AM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by nickse2003, Today, 09:56 AM
          1 response
          27 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Started by ATMtrader0001, Today, 10:08 AM
          5 responses
          37 views
          0 likes
          Last Post ATMtrader0001  
          Started by WHICKED, Today, 09:47 AM
          1 response
          26 views
          0 likes
          Last Post NinjaTrader_Spencer  
          Working...
          X