Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
For loop not working
Collapse
X
-
leduc,
you're probably having an issue because you're passing the amount of data loaded on the chart. Check the LOG tab; I bet you'll see an error.
you want to do something like this
Code:if(CurrentBar < 100) return; for(int i = 0 ; i < 100 ; i++) Print(Close[i].ToString());
Leave a comment:
-
That was not it unfortunately.
If I do that, I only get the closing price of the first bar. If I change the 100 into 1, I get all the closes for all the bars loaded...
Any deas anyone?
leduc
Leave a comment:
-
For loop not working
Dear All,
Why is this loop not printing the last 100 closes ?
regards,
leduc
protectedoverridevoid OnBarUpdate()
{
// double dblIndicatorSig = AtrCross(20)[0];
for (int x = 0; x>100; x++)
{
Print (Close[x]);
}
}
Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Hi
by AveryFlynn
Started by AveryFlynn, Today, 04:57 AM
|
1 response
10 views
0 likes
|
Last Post Today, 07:57 AM | ||
Started by Max238, Today, 01:28 AM
|
4 responses
37 views
0 likes
|
Last Post
by Max238
Today, 07:49 AM
|
||
Started by r68cervera, Today, 05:29 AM
|
1 response
8 views
0 likes
|
Last Post Today, 07:47 AM | ||
Started by geddyisodin, Today, 05:20 AM
|
1 response
11 views
0 likes
|
Last Post Today, 07:38 AM | ||
Started by timko, Today, 06:45 AM
|
2 responses
14 views
0 likes
|
Last Post Today, 07:30 AM |
Leave a comment: