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 > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 04-07-2011, 07:31 AM   #1
marynja
Member
 
Join Date: Jan 2011
Posts: 54
Thanks: 14
Thanked 0 times in 0 posts
Default Diferent result OnBarClose

Hello.

I wrote a code for and indicator and strategy.
Both calculated the same data and are running onBarClose =true.

Then i Print() a var value with the same result in both but curiously the strategy print the var value of 2 bars ago, and indicator print the value of last bar (1 bar ago).

Its normal? I think the both values should be the same.

The var value prints as it:

..
....
Mi var (indicator): 1,23
Mi var (strategy): 0,78
---new bar close---
Mi var (indicator): 2,16
Mi var (strategy): 1,23
---new bar close---
Mi var (indicator): 3,45
Mi var (strategy): 2,16
---new bar close---
Mi var (indicator): 4,91
...
marynja is offline  
Reply With Quote
Old 04-07-2011, 07:59 AM   #2
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 the forum post.

Can you please print the bar number in your prints so we can compare apples to apples.

Print(CurrentBar + Value);

To check to make sure there on the same bar when calcualting.

More then likely I think you might have a ColculateOnBarClose hard set in Initialize() somewhere thats overriding itself when you add it in the indicator is my best bet without looking at the code.

I look forward to assisting you further.
NinjaTrader_Brett is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Brett for this post:
Old 04-07-2011, 08:03 AM   #3
marynja
Member
 
Join Date: Jan 2011
Posts: 54
Thanks: 14
Thanked 0 times in 0 posts
Default

Hello Brett, thank you very much.
Please, sorry me, was my error !!!!!!
I Printed before update the bar in strategy.

Delete the post please. Isnt important.
marynja is offline  
Reply With Quote
Old 04-07-2011, 08:11 AM   #4
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,

No problem. Thanks for letting us know.

Let me know if I can be of further assistance.
NinjaTrader_Brett is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Brett for this post:
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
Entry Times diferent bbucha_stk Strategy Analyzer 1 02-28-2011 02:16 PM
Indicator from diferent time frame "CJS" Version 7 Beta General Questions & Bug Reports 9 11-16-2010 07:34 AM
Diferent value between M-Analyzer and IB michi08 Market Analyzer 17 08-25-2010 09:07 AM
Use an indicator in a diferent time serval Indicator Development 4 11-16-2009 06:21 AM
stochastics from diferent time frames price777999 Charting 2 11-18-2008 03:12 PM


All times are GMT -6. The time now is 01:23 PM.