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
Problematic Indicator
Collapse
X
-
Hi, thanks for posting.
If you are getting a bars ago indexing error then there are not enough bars on the chart when the command is executed. I agree with Nicholas "it is likely a problem with the CurrentBar-PeakIndex[a] or CurrentBar-TroughIndex[DnCount] arguments" without the full code it's hard to tell. You can use Visual Studio to break when the exception occurs and that wil show you what line is causing the problem:
Kind regards,
-ChrisL
-
Originally posted by NicholasJoannette View Post
That doesn't do what he's suggesting to do. UsingCode:if (CurrentBar < 10) return;
Code:ChartBars.Bars.Count > 10
These Draw functions on their own work well. There is likely an issue with the arguments in your calls. If you converted from NT7 to NT8, it is likely a problem with the CurrentBar-PeakIndex[a] or CurrentBar-TroughIndex[DnCount] arguments. Just a guess though - good luck.
Code:Draw.Line(this,"BD"+Var, CurrentBar - PeakIndex[a], Peak[a], CurrentBar - TroughIndex[DnCount], Trough[DnCount], BullishSetup);
So, how do I use "ChartBars.Bars.Count > 10" ?
Leave a comment:
-
Originally posted by omololu View PostYes, I have tried "if(CurrentBar < 10) return;" but it didn't work.Code:if (CurrentBar < 10) return;
Code:ChartBars.Bars.Count > 10
Originally posted by omololu View PostThe provided file contains ONLY extracted relevant portions of the indicator ... it is not expected to compile. It is the Draw.Line, Draw.Ray and Draw.Text that seem to have issues.
Code:Draw.Line(this,"BD"+Var, CurrentBar - PeakIndex[a], Peak[a], CurrentBar - TroughIndex[DnCount], Trough[DnCount], BullishSetup);
Leave a comment:
-
Originally posted by NicholasJoannette View PostThe file you provided doesn't compile and is missing a bunch of code, so it's not of much use. Check your ninjascript output log and the log files as a starter.
Leave a comment:
-
The file you provided doesn't compile and is missing a bunch of code, so it's not of much use. Check your ninjascript output log and the log files as a starter.
Leave a comment:
-
make sure you have enough bars first for example you want to draw from 10 bar back then making sure the chart has 10 bars first
Leave a comment:
-
Problematic Indicator
I have attached extracted relevant portions of a problematic indicator that I converted from NT7 to NT8 ... I call the indicator "Problematic". The indicator successfully compiles, but it does not plot the Drawing objects (Lines, Rays, and Texts) when I load it onto a chart. Why are the Drawing objects not plotting or showing up ?
Problematic.csTags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by samish18, 04-17-2024, 08:57 AM
|
16 responses
55 views
0 likes
|
Last Post
by samish18
Today, 03:30 PM
|
||
Started by arvidvanstaey, Today, 02:19 PM
|
3 responses
9 views
0 likes
|
Last Post Today, 03:23 PM | ||
Started by jordanq2, Today, 03:10 PM
|
2 responses
8 views
0 likes
|
Last Post
by jordanq2
Today, 03:23 PM
|
||
Started by traderqz, Today, 12:06 AM
|
10 responses
18 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
5 responses
47 views
0 likes
|
Last Post Today, 02:36 PM |
Leave a comment: