![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jan 2011
Posts: 54
Thanks: 14
Thanked 0 times in 0 posts
|
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 ... |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
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.
Brett
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Brett for this post: |
|
|
|
#3 |
|
Member
Join Date: Jan 2011
Posts: 54
Thanks: 14
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
No problem. Thanks for letting us know. Let me know if I can be of further assistance.
Brett
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Brett for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |