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
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
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:
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 FilesJesseNinjaTrader Customer Service
-
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.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cmtjoancolmenero, Yesterday, 03:58 PM
|
11 responses
39 views
0 likes
|
Last Post Today, 11:40 AM | ||
Started by FrazMann, Today, 11:21 AM
|
0 responses
5 views
0 likes
|
Last Post
by FrazMann
Today, 11:21 AM
|
||
Started by geddyisodin, Yesterday, 05:20 AM
|
8 responses
52 views
0 likes
|
Last Post Today, 10:45 AM | ||
Started by DayTradingDEMON, Today, 09:28 AM
|
4 responses
26 views
0 likes
|
Last Post Today, 10:47 AM | ||
Started by George21, Today, 10:07 AM
|
1 response
22 views
0 likes
|
Last Post Today, 10:43 AM |
Comment