If(BarsInProgress == ArrayCL && EMA(Closes[ArrayCL] ? The ArrayCL prints but appears not to be usable in trade logic as above. Regards to all.
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
Using an Int variable as an array selector in Multi-instrument strategy
Collapse
X
-
Using an Int variable as an array selector in Multi-instrument strategy
Can I use an Int variable to define the array to be selected on the AddSeries() method? For example the variable int is "ArrayCL" and I use it so:
If(BarsInProgress == ArrayCL && EMA(Closes[ArrayCL] ? The ArrayCL prints but appears not to be usable in trade logic as above. Regards to all.Tags: None
-
Hello elliot5,
Thanks for your reply.
You wrote AddSeries but I think you mean AddDataSeries().
In the help guide for AddDataSeries() is this warning specification, "Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result in an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner."
Reference: https://ninjatrader.com/support/help...dataseries.htmPaul H.NinjaTrader Customer Service
- Likes 1
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Waxavi, Today, 02:10 AM
|
1 response
17 views
0 likes
|
Last Post Today, 03:03 PM | ||
Started by Kaledus, Today, 01:29 PM
|
5 responses
13 views
0 likes
|
Last Post Today, 02:56 PM | ||
Started by Waxavi, Today, 02:00 AM
|
1 response
12 views
0 likes
|
Last Post Today, 02:53 PM | ||
Started by alifarahani, Today, 09:40 AM
|
5 responses
23 views
0 likes
|
Last Post Today, 02:53 PM | ||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
3 responses
17 views
0 likes
|
Last Post Today, 02:41 PM |
Comment