Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Stochastics Indicator value incorrect
Collapse
X
-
Stochastics Indicator value incorrect
Just getting starting with NT and have searched with no luck. I'm writing a strategy that adds a Stochastics indicator to a 5 Minute Chart. The chart and indicator are updating OnEachTick. I'm having an issue where the value shown on the chart does not align with what I'm getting my code. In the attached, I've included what VS shows me in Debug mode for the Values of K[0], D[0], K[1], D[1]. The values at the[1] index match what I see in the Chart/DataBox but the values at index [0] do not. The is 3 points higher. Any help is appreciated.Tags: None
-
Hello donniea21,
Thank you for the post.
For this type of situation I would not suggest to use visual studio to try and observe values as they likely wont match what is being rounded to the Tick size in the user interface. Your code will see the whole value but the Plot will be rounded to the tick size for the instrument.
A better way to do this comparison would be to just use a Print and round your value to the tick size: https://ninjatrader.com/support/help...ghtsub=roundto
Another factor here would be if you manually applied the indicator and are comparing the code values to the manual indicator. That may actually be calculated differently if they have different data being used or different starting points. If you are instead using AddChartIndicator that would be the correct approach to visualizing what the strategy indicator is doing.
I look forward to being of further assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
50 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment