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 ezrollin, Today, 09:01 PM
          1 response
          15 views
          0 likes
          Last Post ezrollin  
          Started by FutTrader9000, Today, 06:20 PM
          0 responses
          29 views
          0 likes
          Last Post FutTrader9000  
          Started by junkone, Today, 05:48 PM
          0 responses
          23 views
          0 likes
          Last Post junkone
          by junkone
           
          Started by Futurestrader00, Today, 05:10 PM
          1 response
          29 views
          0 likes
          Last Post NinjaTrader_ShawnB  
          Started by Gerik, 03-08-2021, 01:25 AM
          5 responses
          49 views
          0 likes
          Last Post NinjaTrader_ShawnB  
          Working...
          X