NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Market Analyzer

Market Analyzer Support for the NinjaTrader Market Analyzer.

Reply
 
Thread Tools Display Modes
Old 08-05-2012, 11:24 AM   #1
Blackburn
Junior Member
 
Join Date: Dec 2010
Posts: 29
Thanks: 2
Thanked 1 time in 1 post
Default No signal by Momentum definition

Hallo,

I have programmed the following code (is part of an indicator for signals for the MA):

...
protected override void OnBarUpdate()
{
// Make sure there are enough bars.
if (CurrentBar < 10)
return;

//ODR LONG:

// Kurzfristige Trendausrichtung:
if (EMA(10)[0] > EMA(10)[2]

//Momentum Entwicklung:
&& Momentum(EMA(10), 10)[0] > 0
&& Momentum(EMA(10), 10)[0] > Momentum(EMA(10), 10)[2]


//Langfristige Trendausrichtung:
&& EMA(8)[0] > EMA(10)[0]
&& EMA(10)[0] > EMA(20)[0]
&& EMA(20)[0] > EMA(50)[0]
&& EMA(20)[0] > SMA(200)[0]
&& EMA(50)[0] > SMA(200)[0]

// 2. SwingHigh - Pattern - Definition LONG:
&& CrossAbove(Close, Swing(5).SwingHigh, 1))

{
Value.Set(1);
}

Problem: the indicator ignored the momentum code. Wehre ist the error?
Blackburn is offline  
Reply With Quote
Old 08-05-2012, 06:37 PM   #2
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

Blackburn,

I am not seeing anything immediately obvious here. Could you describe what is happening here in a bit more detail?
NinjaTrader_AdamP is offline  
Reply With Quote
Old 08-06-2012, 02:12 AM   #3
Blackburn
Junior Member
 
Join Date: Dec 2010
Posts: 29
Thanks: 2
Thanked 1 time in 1 post
Default

Hallo,

please see the attach files. One of the points is, the the MOM must <0; on the pictures you see that isn't so. I got a signal (value 1) in the MA.

would it be possible that it is up to the settings in MA?
- # of bars look back: 256
- calculate on bar close: false

Blackburn
Attached Images
File Type: jpg WFM (Daily) 25_02_2012 - 04_08_2012.jpg (103.6 KB, 7 views)
Attached Files
File Type: cs AB-SwingHLCrossMA2.cs (7.8 KB, 0 views)
Blackburn is offline  
Reply With Quote
Old 08-06-2012, 02:13 AM   #4
Blackburn
Junior Member
 
Join Date: Dec 2010
Posts: 29
Thanks: 2
Thanked 1 time in 1 post
Default

MOM must be > 0
Blackburn is offline  
Reply With Quote
Old 08-06-2012, 06:53 AM   #5
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Thanks for that information.

Specifically the session template between market analyzer and chart need to match and also the numbers of days back loaded for indicators need to also match.

Please right click on the market analyzer and select properties.

Its there you can get access to the session template.

Finally: right click columns on the market analyzer. Set the indicator column to load the same amount of days/bars back that the chart is loading.

-Brett
NinjaTrader_Brett is offline  
Reply With Quote
Old 08-06-2012, 07:01 AM   #6
Blackburn
Junior Member
 
Join Date: Dec 2010
Posts: 29
Thanks: 2
Thanked 1 time in 1 post
Default

Hallo,
do you mean the - # of bars look back?
The # of bars look back in the properties of the MA and for the indicator must have the same value; is this right?
Blackburn
Blackburn is offline  
Reply With Quote
Old 08-06-2012, 07:10 AM   #7
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Correct, this would need to be roughly the same amount of bars back you have in your chart for the same signal.

-Brett
NinjaTrader_Brett is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SPY Instrument definition chobotnice Connecting 1 05-16-2012 02:23 AM
AvgPrice definition arbuthnot Strategy Development 1 05-11-2012 02:36 AM
NT7 definition of CalculateOnBarClose zeeee Strategy Development 9 08-05-2010 06:53 AM
Does anyone have a link to ZiNonLagMA definition? crmcwi Indicator Development 3 09-22-2009 11:00 AM
Time Definition binwang2 General Programming 1 05-13-2009 11:23 AM


All times are GMT -6. The time now is 04:48 AM.