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
Add horizontal lines to indicator in strategy script
Collapse
X
-
In your example you useCode:Overlay=true;
Code:DrawOnPricePanel = false;
Code:Overlay=false;
I tried to useCode:Middle.Panel=1;
How can I set the panel for every indicator in indicator script?
Comment
-
Originally posted by NinjaTrader_Cal View PostAlexstox,
Changing the Overlay to false will plot on a new panel.
I tried to use
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
-
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 -
Code: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?
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 Graci117, Today, 09:02 PM
|
1 response
6 views
0 likes
|
Last Post Today, 09:09 PM | ||
Started by ETFVoyageur, Today, 07:55 PM
|
0 responses
7 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:55 PM
|
||
Started by janio973, Today, 07:24 PM
|
1 response
7 views
0 likes
|
Last Post Today, 07:35 PM | ||
Started by aligator, 01-06-2022, 12:14 PM
|
4 responses
246 views
0 likes
|
Last Post
by john_44573
Today, 06:11 PM
|
||
Started by reynoldsn, Today, 05:56 PM
|
0 responses
14 views
0 likes
|
Last Post
by reynoldsn
Today, 05:56 PM
|
Comment