Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Custom ADL indicator.
Collapse
X
-
Hello yunakhan1,
Thank you for the question.
For creating a custom ADL indicator you could follow these steps to accomplish what you are looking to do.
First to make things easy you can create a duplicate of the ADL that you can edit by doing the following:- From the NinjaTrader Control Center, Click Tools -> Edit NinjaScript -> Indicator
- Next Select the ADL and press OK
- Now when the NinjaScript Window opens up, Right click and click Save As.
- Now give the new indicator a name, maybe ADL2 for example and save it.
- The already open NinjaScript window has been switched to the newly created indicator.
Now that you have your ADL base, you can add the condition to change the color of the plot when it is rising or falling.
There is an excellent example of the code required in the help guide reference for PlotColors located here: http://www.ninjatrader.com/support/h...plotcolors.htm
Now in the ADL code, look for the line that says this
AD is the dataseries that is being used for holding the ADL's calculated data, AD is what you will need to check if it is rising or falling.Code:AD.Set((CurrentBar == 0 ? 0 : AD[1]) + (High[0] != Low[0] ? (((Close[0] - Low[0]) - (High[0] - Close[0])) / (High[0] - Low[0])) * Volume[0] : 0));
Right below this line you will want to copy the help guide example so it looks like this:
Note in the statement if(Rising(AD))Code:AD.Set((CurrentBar == 0 ? 0 : AD[1]) + (High[0] != Low[0] ? (((Close[0] - Low[0]) - (High[0] - Close[0])) / (High[0] - Low[0])) * Volume[0] : 0)); if (Rising(AD)) PlotColors[0][0] = Color.Blue; else if (Falling(AD)) PlotColors[0][0] = Color.Red; else PlotColors[0][0] = Color.Green;
I have changed what the example has to reflect the data series in the ADL which is the AD
Now this is checking if the AD is rising, falling or if not coloring the line Green.
I have attached the full example in case this is hard to follow.
Please let me know if I may be of additional assistance.Attached Files
-
Hello yunakhan1,
In an indicator you have access to a few different types of line style that can be used with the Plot. An actual bar style like OHLC or Candle Stick would not be able to be used.
If you take a look at this document, it lists the available options. Additionally you can view these by applying any indicator that uses a plot, SMA for example and change the type in the indicators properties on the chart.
Please let me know if I may be of additional assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
579 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment