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
Indicator - Who Called Me?
Collapse
X
-
Indicator - Who Called Me?
Is there a way to determine, within OnBarUpdate, if the indicator is being placed on a chart as opposed to being called from the Market Analyzer? I want to display a message box if the indicator is being placed on a chart but not if it is being called because it is a column in the market analyzer.Tags: None
-
Hello dkrumholz,
Thank you for your post.
I am not aware of a method to check if the indicator is applied to a chart or Market Analyzer.
However, you may wish to create a custom Market Analyzer column alone for this indicator. You can view the code used for the Market Analyzer columns by going to the following directory on your PC: (My) Documents\NinjaTrader 7\bin\Custom\Market Analyzer
Custom Market Analyzer columns are not supported in the confines of NinjaScript support but if you have any questions I may be able to point you in the right direction.
Please let me know if I may be of further assistance.Last edited by NinjaTrader_PatrickH; 05-26-2013, 08:17 AM.
-
Originally posted by dkrumholz View PostIs there a way to determine, within OnBarUpdate, if the indicator is being placed on a chart as opposed to being called from the Market Analyzer? I want to display a message box if the indicator is being placed on a chart but not if it is being called because it is a column in the market analyzer.
1) If you are using the same period, the indicator might be cached in both places and there is only 1 instance from my understanding.
2) Override Plot, and set a variable...for your OnBarUpdate to check. I'm going to theorize that Market Analyzer won't call that Plot. I could be mistaken..
Please report back. Thanks.
Comment
-
Originally posted by dkrumholz View PostThanks. Not only did that occur to me - but I tested it. I was pretty surprised, but the plot method still got called!
Let's go 1 step further -
In the overriden plot, is either ChartControl == null ? Bars == null? That could determine if chart or 'something else' such at Market Analyzer.
Comment
-
Originally posted by dkrumholz View PostIs there a way to determine, within OnBarUpdate, if the indicator is being placed on a chart as opposed to being called from the Market Analyzer? I want to display a message box if the indicator is being placed on a chart but not if it is being called because it is a column in the market analyzer.Last edited by koganam; 05-27-2013, 04:35 PM.
Comment
-
-
Originally posted by dkrumholz View PostI don't find ChartControl documented. Where might I find its definition and use?
Comment
-
Originally posted by dkrumholz View PostI don't find ChartControl documented. Where might I find its definition and use?
I put the code below.
if ( ChartControl == null )
if that doesn't work, checks Bars
if ( ChartControl == null || Bars == null )
{
//no chart, set a flag
}
else
{
// we have a chart, set flag
}
Comment
-
My Workaround
Originally posted by sledge View PostJust type in ChartControl
I put the code below.
if ( ChartControl == null )
if that doesn't work, checks Bars
if ( ChartControl == null || Bars == null )
{
//no chart, set a flag
}
else
{
// we have a chart, set flag
}
Code:[Description("0 from a chart, 1 from strategy , 2 from market analyzer")] [GridCategory("Parameters")] public int CalledFrom { get { return calledFrom ; } set { calledFrom = value ; } }
A suggestion for ninja: implement it internally in NinjaScript. Looking at your caching code, it should be simple.Last edited by xTrader1; 01-01-2014, 08:41 AM.
Comment
-
Originally posted by xTrader1 View PostThe above didn't work for me. But I have rather ugly workaround. Just place an additional parameter in your indicator:
Code:[Description("0 from a chart, 1 from strategy , 2 from market analyzer")] [GridCategory("Parameters")] public int CalledFrom { get { return calledFrom ; } set { calledFrom = value ; } }
A suggestion for ninja: implement it internally in NinjaScript. Looking at your caching code, it should be simple.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cre8able, Today, 01:16 PM
|
1 response
8 views
0 likes
|
Last Post Today, 01:30 PM | ||
Started by chbruno, 04-24-2024, 04:10 PM
|
3 responses
48 views
0 likes
|
Last Post Today, 01:29 PM | ||
Started by samish18, Today, 01:01 PM
|
1 response
6 views
0 likes
|
Last Post Today, 01:25 PM | ||
Started by WHICKED, Today, 12:56 PM
|
1 response
8 views
0 likes
|
Last Post Today, 01:17 PM | ||
Started by WHICKED, Today, 12:45 PM
|
1 response
11 views
0 likes
|
Last Post Today, 01:08 PM |
Comment