Did you copy the same format for your indicator (series added to Inititialize?)
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Multi Timeframe and Method Name Expected
Collapse
X
-
Indicator issue
Hi Ryan, yes exactly the same from strategy to indicator. I've this many times before with no problem. It compiles ok. The problem is the bars wont paint as an indicator but is ok as a strategy. Is it possible for you to can try it. If you paste in that code and see if you can get any bars to paint?
Cheers
DJ
Comment
-
I get this message when trying to run:
10/29/2010 4:05:04 PM Default Error on calling 'OnBarUpdate' method for indicator 'dj' on bar 0: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.
You need current bar and current bars checks to make sure you aren't accessing invalid bars.
The series you are accessing are range, so this number can vary based on how many bars it takes to form compared to the primary series.
if (CurrentBar < x) return;
You'll have to experiment with values for x until you find one that works for you. I used a value of 20 which worked with ES and 1 minute bars.Ryan M.NinjaTrader Customer Service
Comment
-
Perfect..
Thanks Ryan, that worked perfectly! I also applied that to another problem one and it resolved that as well. I do have another odd one though which has me stumped. What I'm trying to do is to alert a hammer bar (small body big tail on a candle. I am using the code below on 50 cent range bars. So what it says is draw a triangle if the difference between the open and close is less that 20 cents, The problem is it doesn't work and gives the ones above 20 cents as well. Now if I put it like this
if ((Close[0] - Open[0])> .4) it does it correctly and gives me only this ones with 0.4 or above. So any idea why it works for above 0.4 but doesn't work on one less than 0.2? Thanks. DJ
Code:
// Condition set 1
if ((Close[0] - Open[0])< .2)
{
DrawTriangleUp("My triangle up" + CurrentBar, false, 0, Low[0] + -15 * TickSize, Color.Lime);
}
Comment
-
Dots issues
Thanks Kyle, I have another one here. Still working on it. Please find attached a chart and you will see small circles under/over the bars. I achieve this with the following code:
DrawDot("MyArrowDown"+CurrentBar, false, 0, Low[0] -Tickamount*TickSize, Color.White);
The problem is it's hard to see what is going on and would prefer to see the circles in a single row say plotting it at a price of 700 if the dots are under the bar and say 710 if they are above the bar.
Cheers
DJ
Comment
-
The only object we have that can stay in a fixed position is DrawTextFixed(). The other objects require a Y value. You can specify a y value or make it relative to OHLC bars. Unfortunately there is no supported way of drawing according to the relative position on the Y Axis.Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
576 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment