Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Add horizontal lines to indicator in strategy script
Collapse
X
-
In your example you useBut with this property indicator is drawn on price panel. Even if I useCode:Overlay=true;
So, if I setCode:DrawOnPricePanel = false;
this mean just that indicator chart will be behind price chart?Code:Overlay=false;
I tried to useparameter but indicator script warn about error.Code:Middle.Panel=1;
How can I set the panel for every indicator in indicator script?
Comment
-
So, what the difference between DrawOnPricePanel and Overlay?Originally posted by NinjaTrader_Cal View PostAlexstox,
Changing the Overlay to false will plot on a new panel.
I tried to use
parameter but indicator script warn about error.Code:Middle.Panel=1;
How can I set the panel for every indicator in indicator script? (One indicator in panel 2, second in panel 3 ...)
Comment
-
DrawOnPricePanel is for the draw objects. This will let you either display them on the Price series or in its own separate panel.
The Overlay is meant for plots and lines. When set to true it will display over the price in the same panel as the bars.
When set to false it will display in its own panel. Setting to false as well, will set the Panel parameter in the indicator settings to New Panel when first applying it.
You can assign an indicator its own panel however, this is unsupported code and would be able to provided documentation or assistance for it.
ChartControl.Indicators[0].PanelUI = 1;Cal H.NinjaTrader Customer Service
Comment
-
So, I've moved indicator code from strategy to separate indicator. I need one thing. How can I "manipulate" the indicator from strategy? Just add the same variables to strategy?Originally posted by NinjaTrader_Cal View PostAlexstox,
You won't be able to use DrawOnPricePanel in the Strategy script. However, what you can do is create an indicator that does all this functionality and then call that indicator from the Strategy.
Example of adding the SMA to a Strategy -
Otherwise, you would need to use the plot option that I outlined in posts 6 and 8Code:Add(SMA(14));
Comment
-
Alexstox,
You can modify the indicators' pen class and more inside the initialize or OnBarUpdate. You will need to use the Plot method -
http://www.ninjatrader.com/support/h...html?plots.htm
Additionally, take a look at this link below -
http://www.ninjatrader.com/support/f...ad.php?t=48853Cal H.NinjaTrader Customer Service
Comment
-
Hello guys! HAPPY NEW YEAR!!!


What if my strategy should do something if my indicator conditions come true?! How to implement this interaction in strategy?
For example, there are some conditions for long and other for short in Indicator1. So, variables only in Indicator1. And I should buy or sell in my strategy, but strategy script without those variables. So, how to write conditions for entries?
Variable A=1 in indicator. How can I check value of this variable in strategy script?
2) How to <<AutoScale = false;>> only for several component of indicator?
3) If my indicator has 3 arguments, and I Add(MyIndicator(argument1, argument2, argument3));
How to add MyIndicator with default value of arguments? (Add(MyIndicator())Last edited by alexstox; 01-04-2014, 01:49 PM.
Comment
-
Alexstox,
You may want to take a look at the link below on Vaild input data for indicators -
http://www.ninjatrader.com/support/h..._indicator.htmCal H.NinjaTrader Customer Service
Comment
-
For example, there are some conditions for long and other for short in Indicator1. So, variables only in Indicator1. And I should buy or sell in my strategy, but strategy script without those variables. So, how to write conditions for entries?
Variable A=1 in indicator. How can I check value of this variable in strategy script?
Comment
-
Alexstox,
You can set up conditional statements to check values, if those values are not plots then you would want to take a look at the link below on exposing your values -
http://www.ninjatrader.com/support/f...ead.php?t=4991
If they are plots then you would want to look at the Valid Input link from the help guide -
http://www.ninjatrader.com/support/h..._indicator.htmCal H.NinjaTrader Customer Service
Comment
-
I will check this. Thanks.
May I use IF() in Initialize()? For example, to filter ADD() only for some instruments?
And how to check what instrument now is using in strategy or indicator?Code:if(instrument==MSFT) do something
2) When I tried to call for MyIndicator() in strategy, this caused an error because strategy required MyIndicator(1var, 2var, 3var). That's why I asked about how to call MyIndicator as default just MyIndicator()?Last edited by alexstox; 01-07-2014, 02:52 PM.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
603 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
349 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
104 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
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
560 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Please help! =(
Comment