Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Add instrument to chart in STRATEGY Analyzer
Collapse
X
-
Well. I tried my expression in strategy. Still this error.
I sighted that it occurs on bar next to what I set in Backtest as Min Bars required=20. Erroe occurs on 21 bar. And in indicator script I set other value=400.
But I think it's not important what value is there. More important to set condition when indicator will check if it has some value.
Comment
-
There is bars object in strategy script, for which I write
if (CurrentBars[0] <= BarsRequired) return;
There is indicator object in strategy script, for which I can't use "CurrentBars[0] <= BarsRequired"
What can I write for indicator in strategy to check is it have some value or not?!?!?
Because MyIndex() starts to have some value from 1993 year, and bars object starts from 1990. That's why when everything is OK with bars object, MyIndex() still doesn't have any value.
Comment
-
Alexstox,
I believe this example is what you are looking for -
http://www.ninjatrader.com/support/f...ad.php?t=33061
This is a way to check if your indicator's plots are valid before accessing them.Cal H.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Cal View PostAlexstox,
I believe this example is what you are looking for -
http://www.ninjatrader.com/support/f...ad.php?t=33061
This is a way to check if your indicator's plots are valid before accessing them.
Comment
-
First is from dotnetperls which is a good resource -
http://www.dotnetperls.com/containsvalue
the second is from the MSDN site for all .NET and C# related items -
http://msdn.microsoft.com/en-us/library/0w4e0fzs.aspxCal H.NinjaTrader Customer Service
Comment
-
Well. I set in strategy script
if(!MyIndex(MyIndex1).Values[0].ContainsValue(0)) return;
But this still caused error. Maybe because there are no "0" value? How to set "nothing" or "no data" instead of "0".
In indicator I don't know what to set, because I use every bar there and this can't help me
if(CurrentBar % N == 0) EveryNPlot.Set(Median[0]);
Comment
-
This checks if you have NOT called a "Set" method on the DataSeries for the current bar your processing. Internally a dummy value does exist and this is what this checks for in the ContainsValue() check. This is coming back true then indicating that something has been set.
We needed to investigate further on the dataSeries "Set" side to see why a value is being set for the current bar.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by carnitron, Today, 08:42 PM
|
0 responses
5 views
0 likes
|
Last Post
by carnitron
Today, 08:42 PM
|
||
Started by strategist007, Today, 07:51 PM
|
0 responses
6 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,973 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
8 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
||
Started by rhyminkevin, Today, 04:58 PM
|
4 responses
58 views
0 likes
|
Last Post
by dp8282
Today, 06:13 PM
|
Comment