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 > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 12-17-2008, 03:16 AM   #1
John833
Senior Member
 
Join Date: Jun 2008
Location: Hong Kong
Posts: 214
Thanks: 0
Thanked 0 times in 0 posts
Default Discrepancies between indicator value and Output

Hello

I have been getting strange discrepancies with the chart value of the ADX indicator and its output value on a running strategy (This happens at the start of a session not during the session, also, this doesn't happen all the time.... only 3 times so far)

All other indicators (I use altogether 5 other indicators) show correct values in both the output and on my chart.

To solve the problem I have had to Repair and Reset the DB, shut down NT and restart. Then all chart values and script output values the same.

Obviously this is not ideal, so would anyone have thoughts on why I would be experiencing this problem, and can it be resolved?

Thanks in advance
Last edited by John833; 12-17-2008 at 03:38 AM.
John833 is offline  
Reply With Quote
Old 12-17-2008, 06:37 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

Hi John833, please review these tips for improving performance - http://www.ninjatrader-support.com/H...rformanceTips1

Did you have any power outages or disconnects that could have impacted your database integrity?

Thanks!
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-17-2008, 07:07 AM   #3
John833
Senior Member
 
Join Date: Jun 2008
Location: Hong Kong
Posts: 214
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Bertrand, I have already seen the performance website, and everything checks out ok.

No I haven’t had any power outages or have done anything different to the PC.

Its concerning as there seems to be no reason why this happens….

Have you had any other experience of this?
John833 is offline  
Reply With Quote
Old 12-17-2008, 07:14 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

Hi John833,

Which datafeed are you running?

Does it happen under a lot of load on the PC, you may have to reduce the charts open or applications running to see if it makes a difference.

If this is reproducible for you, we would appreciate you sending the needed steps to generate the issue to support at ninjatrader dot com, so we can look into it. Thanks!
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-17-2008, 07:30 AM   #5
John833
Senior Member
 
Join Date: Jun 2008
Location: Hong Kong
Posts: 214
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Bertrand

My data feed is from my broker IB. (But when this problem occurs with the ADX indicator, all my other indicators are functioning fine)
I use a new (3mth old) hi-spec pc 4Gb ram etc, and this only runs IB and NT, nothing else (except Norton360). CPU and RAM usage rarely go above 65%.

The problem is that its not reproducible, so I have no idea where its coming from…

Have you had any stability issues with the ADX indicator?
Last edited by John833; 12-17-2008 at 07:33 AM.
John833 is offline  
Reply With Quote
Old 12-17-2008, 07:36 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

Hi, none that I'm aware of. Your setup is sound - if you wish send in your logs and we take a look if something is suspicious.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-17-2008, 07:40 AM   #7
John833
Senior Member
 
Join Date: Jun 2008
Location: Hong Kong
Posts: 214
Thanks: 0
Thanked 0 times in 0 posts
Default

ok, I'll do that when it happens again, everything has been reset so I don't have any logs at the moment...

Thanks for your help
John833 is offline  
Reply With Quote
Old 12-17-2008, 07:42 AM   #8
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

You're welcome, please do...
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-18-2008, 11:48 AM   #9
John833
Senior Member
 
Join Date: Jun 2008
Location: Hong Kong
Posts: 214
Thanks: 0
Thanked 0 times in 0 posts
Default

Bertrand, this is what I have discovered with the ADX anomaly.

After repairing and resetting the DB, when I load up the chart and have the script running, the ADX value in the output is exactly the same as the ADX value on the chart, however if I reload historical data, the indicator values of the ADX changes…
If I reset and repair the DB then the ADX values fall back into place….

Any thought on why this would happen?
John833 is offline  
Reply With Quote
Old 12-18-2008, 11:55 AM   #10
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

Hi John833,
Thanks for reporting back your findings - please try to remove the 'CalculateOnBarClose' setting from your indicator file you call in your strategy and let me know if it improves your situation. Thanks!
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-18-2008, 12:00 PM   #11
John833
Senior Member
 
Join Date: Jun 2008
Location: Hong Kong
Posts: 214
Thanks: 0
Thanked 0 times in 0 posts
Default

do you mean the ADX file, sorry I don't quite follow...
John833 is offline  
Reply With Quote
Old 12-18-2008, 12:04 PM   #12
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

Yes, please change it in the indicator you call from the strategy to diplay it on the chart...
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-18-2008, 12:10 PM   #13
John833
Senior Member
 
Join Date: Jun 2008
Location: Hong Kong
Posts: 214
Thanks: 0
Thanked 0 times in 0 posts
Default

Bertrand

I have the standard ADX indicator file (the one that comes with NT) open, but I don't see a 'CalculateOnBarClose' statement?
John833 is offline  
Reply With Quote
Old 12-18-2008, 12:24 PM   #14
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

Hi John,
Thanks for checking - then you should be fine from that angle...please also check your 'Display update interval' in the Chart properties and set it to 0 for testing this issue.

Another idea would be to create a very simple strategy that only calls the ADX with the Add() and then Print() out this value to the output window to compare with the chart.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-18-2008, 12:38 PM   #15
John833
Senior Member
 
Join Date: Jun 2008
Location: Hong Kong
Posts: 214
Thanks: 0
Thanked 0 times in 0 posts
Default

ok I've set the interval to 0, and reloaded the chart, and the discrepancy is even more pronounced....

I already have ADX in the output from my strategy, but what I am concerned about is why am I seeing different values on the chart?

It also leads to the question is the value that I am using in my script accurate and the chart inaccurate, or visa versa?

All I am certain of is that once the DB is repaired and reset, values are the same, as soon as you reload the chart, the values change.

Do you think this can this be resolved?
John833 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
Discrepancies and lack of functionality. bsamani General Programming 6 12-19-2008 07:02 AM
Print to Output heech Strategy Development 3 11-15-2008 07:41 PM
Indicator: Using custom events to output the current Level II data book NinjaTrader_Josh Reference Samples 0 03-04-2008 11:40 AM
Indicator output is different when invoked by strategy zoltran Strategy Development 14 12-26-2007 07:07 AM
indicator output double available to a strategy gluebunny Strategy Development 1 12-09-2007 02:49 AM


All times are GMT -6. The time now is 05:21 AM.