Problematic.cs
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
-
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
-
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.
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.
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);
Comment
-
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" ?
Comment
-
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,
-ChrisLChris L.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by TheWhiteDragon, 01-21-2019, 12:44 PM
|
4 responses
542 views
0 likes
|
Last Post
by PaulMohn
Today, 04:09 AM
|
||
Started by GLFX005, Today, 03:23 AM
|
0 responses
3 views
0 likes
|
Last Post
by GLFX005
Today, 03:23 AM
|
||
Started by XXtrader, Yesterday, 11:30 PM
|
2 responses
11 views
0 likes
|
Last Post
by XXtrader
Today, 03:07 AM
|
||
Started by Waxavi, Today, 02:10 AM
|
0 responses
7 views
0 likes
|
Last Post
by Waxavi
Today, 02:10 AM
|
||
Started by TradeForge, Today, 02:09 AM
|
0 responses
14 views
0 likes
|
Last Post
by TradeForge
Today, 02:09 AM
|
Comment