![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Member
Join Date: Mar 2007
Location: , ,
Posts: 55
Thanks: 0
Thanked 0 times in 0 posts
|
Hello,
I created a test indicator (accepting the default values of the wizard just to have a bare minimum indicator, in order to debug the odd behavior) The resulting created indicator code and the test code: protected override void OnBarUpdate() { Print(""); for (int idx =0; idx < 20; idx++) { Print("Value before : " + Close[idx]); } Print(""); // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. Plot0.Set(Close[0]); } After loading this to a "3Minutes YM Chart, Connected to simulator", I get the following odd result: Value before : 10594 1. The print shows only one value (the above value) 2. This value is not even the last value showing on the chart ( 10729 is the last value). 3. 10 minutes, 30 minutes and An hour later, I still get the same single value. I changed the code to the following: protected override void OnBarUpdate() { Print("Value After : " + Close[0]); Print("Value After 2: " + Close[1]); Print("Value After 3: " + Close[2]); Print(""); for (int idx =0; idx < 20; idx++) { Print("Value before : " + Close[idx]); } Print(""); // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. Plot0.Set(Close[0]); } The result (some 10 minutes later): Value After : 10594 That's it!??? No need to tell you that this is very odd and extremely frustrating. I desperately need your help and solution to this bug as all my work is currently suspended until this is resolved. Obi |
|
|
|
|
|
#2 |
|
Certified NinjaScript Consultant
Join Date: Sep 2006
Location: New York, USA
Posts: 774
Thanks: 1
Thanked 7 times in 5 posts
|
First, you need to convert the Close[] to a string before you print it out
Code:
Close[0].ToString(); Code:
if(CurrentBar < 20)
return;
hope this helps
"You look closely enough, you can find everything has a ... weak spot where it can break, sooner or later"
PureLogikTrading |
|
|
|
|
|
#3 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
|
Hi Obi, I already responded to your email sent to our support inbox.
Thanks for your input mrlogik.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#4 |
|
Member
Join Date: Mar 2007
Location: , ,
Posts: 55
Thanks: 0
Thanked 0 times in 0 posts
|
Hi NinjaTrader_Bertrand and Mr.Logik,
The following still give the same result as explained earlier: protected override void OnBarUpdate() { Print("Value After : " + Close[0].ToString()); Print("Value After 2: " + Close[1].ToString()); Print("Value After 3: " + Close[2].ToString()); Print(""); // for (int idx =0; idx < 20; idx++) // { // Print("Value before : " + Close[idx]); // } // Print(""); // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. Plot0.Set(Close[0]); } Result: Value After : 10594 As you can see, hours after I reported the issue, I'm still getting the same single value. Can you please have a look at this. It's blocking everything. Obi |
|
|
|
|
|
#5 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
I did not see that you added this to your code:
if(CurrentBar < 20) return;
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Certified NinjaScript Consultant
Join Date: Sep 2006
Location: New York, USA
Posts: 774
Thanks: 1
Thanked 7 times in 5 posts
|
Check the LOG tab as well for errors
"You look closely enough, you can find everything has a ... weak spot where it can break, sooner or later"
PureLogikTrading |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NinjaScript Buggy and Inacurate. Please Help !!! | Obi | Miscellaneous Support | 1 | 02-15-2009 08:59 AM |
| Need Help with NinjaScript | duckfan312 | Strategy Development | 1 | 10-31-2008 08:06 AM |
| Workspaces buggy... | funk101 | Historical NinjaTrader 6.5 Beta Threads | 1 | 11-24-2007 01:49 PM |
| Control center interface buggy... | funk101 | Miscellaneous Support | 5 | 10-21-2007 04:14 AM |
| BUG: Manually entering executions is buggy in NT6 | Joel Reymont | Suggestions And Feedback | 9 | 01-06-2007 08:19 AM |