Any Help out there available?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Need help coming up with a solution
Collapse
X
-
Need help coming up with a solution
I want create a Sentiment indicator for day trading, that uses a set number of stocks and compares them with each other. But I want to upload the list of stocks from a File, do not really care about the extension. The reason for this is that the list may change from Broker to broker. I want to put it into an array in order to work with them. This is to use it in an automatic strategy or another indicator
Any Help out there available?Tags: None
-
Hello Yandychang,
Thank you for your post.
You can take a look at our reference sample for reading from a file at the following link: http://www.ninjatrader.com/support/f...ead.php?t=3476
Please let me know if I may be of further assistance.
-
Hello
Thanks for your help. Do i need to " Add( instruments, period types, index)" all of the symbols from the txt Files? If yes, can it be done from a For cycle in the initialize method? Or would i need to do them one by one, it would deffeat the purpose of the txt file
Comment
-
You can use a for loop.Originally posted by Yandychang View PostThanks for your help. Do i need to " Add( instruments, period types, index)" all of the symbols from the txt Files? If yes, can it be done from a For cycle in the initialize method? Or would i need to do them one by one, it would deffeat the purpose of the txt file
Comment
-
Hello
I need a few of them, because I want to compare their price to the beginning of the day. and it needs to be statistically significant. So, let me see If I got it right, I only Load the File once on FirstBarOfSession. then, I do a loop and Add all the instruments to a DataSeries. Now, is That's During initialize. ? Would that bring me any problems when running the script.?
Comment
-
No. You load your list by Add()ing them on first application to the chart, when the Initialize() method is called.Originally posted by Yandychang View PostI need a few of them, because I want to compare their price to the beginning of the day. and it needs to be statistically significant. So, let me see If I got it right, I only Load the File once on FirstBarOfSession. then, I do a loop and Add all the instruments to a DataSeries. Now, is That's During initialize. ? Would that bring me any problems when running the script.?
Comment
-
Hello
Got it to open the txt file... but Right after it starts the while loop... at the level of the String[] Split is throws an exception... I created the attached TXT file. it does not seem to be reading the Characters into a full string... I copied the code from the sample you sent me to... but might have I made a mistake. Can you see an error?
Comment
-
Your while statement is a null statement, so your Line object is null after the while loop is parsed. Remove the semi-colon that terminates the statement, making it null.Originally posted by Yandychang View PostGot it to open the txt file... but Right after it starts the while loop... at the level of the String[] Split is throws an exception... I created the attached TXT file. it does not seem to be reading the Characters into a full string... I copied the code from the sample you sent me to... but might have I made a mistake. Can you see an error?
Comment
-
OK
Thank you very, its seems to be debugged, the entire Initialize Method runs well. I appreciate your help. I have been trying to write this for a long time now... Thank you...
Comment
-
Comment
-
Your for loops do not make sensible statements. 'For "a" starting at 1, while "a" is less than 1' makes no logical sense. It is not possible, so the statements are never executed to create any escapes. "a" can never be less than 1, if "a" starts at 1.Originally posted by Yandychang View PostGuys Im having to Debug my OnBarUpdate Method. It seems to work Up to the point Highlightted in blue and attached is the error I get, Apparently I get a result out of range specifically on bar 20... any errors you might see?
Comment
-
Hello
I fixed the 1 and changed it to a zero, the other value in the loop i, is less than i... i returns the amount of symbols I have on the file i read, the actual value is 55... I think I found where My error is... I need to do a CurrentBar for All my BarArrays... I did an
(if Currentbars[a]< BarsRequired Return) inside a loop for my 55 instruments, then I come up with the issue i'm having now... it seems like my BarsArray[1] does not receive values . Because its CurrentBars[0] Value is always -1, while BarsArray[0] CurrentBars[0] value changes up to 1640s. so it constantly loops and returns at BarsArray[1]. I am actually running the indicator and everytime a new bar forms it gives me my Print Message I put to debug it. when I try to pull up the instrument that gives me the CurrentBars[]=-1 the chart is blank,so maybe the error is not on the programming side, maybe is from the data feed...
Comment
-
Your first step would be to rem out your loop for adding instruments, add a few instruments manually, then run the indicator and see if your escape loop works correctly.Originally posted by Yandychang View PostI fixed the 1 and changed it to a zero, the other value in the loop i, is less than i... i returns the amount of symbols I have on the file i read, the actual value is 55... I think I found where My error is... I need to do a CurrentBar for All my BarArrays... I did an
(if Currentbars[a]< BarsRequired Return) inside a loop for my 55 instruments, then I come up with the issue i'm having now... it seems like my BarsArray[1] does not receive values . Because its CurrentBars[0] Value is always -1, while BarsArray[0] CurrentBars[0] value changes up to 1640s. so it constantly loops and returns at BarsArray[1]. I am actually running the indicator and everytime a new bar forms it gives me my Print Message I put to debug it. when I try to pull up the instrument that gives me the CurrentBars[]=-1 the chart is blank,so maybe the error is not on the programming side, maybe is from the data feed...
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
608 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
355 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment