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!
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
NinjaTrader
How can I add mid point line?
Collapse
X
-
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?
Tags: None
-
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
-
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
-
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
-
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 r68cervera, Today, 05:29 AM
|
0 responses
2 views
0 likes
|
Last Post
by r68cervera
Today, 05:29 AM
|
||
Started by geddyisodin, Today, 05:20 AM
|
0 responses
3 views
0 likes
|
Last Post
by geddyisodin
Today, 05:20 AM
|
||
Started by JonesJoker, 04-22-2024, 12:23 PM
|
6 responses
35 views
0 likes
|
Last Post
by JonesJoker
Today, 05:14 AM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
12 responses
3,239 views
0 likes
|
Last Post
by Leafcutter
Today, 05:08 AM
|
||
Hi
by AveryFlynn
Started by AveryFlynn, Today, 04:57 AM
|
0 responses
6 views
0 likes
|
Last Post
by AveryFlynn
Today, 04:57 AM
|
Comment