So basically what I would like to achieve is finding divergence in two bars closes and the stochastics k.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Divergence indicator
Collapse
X
-
-
Hello seddka,
Thanks for your post.
I am not aware of any indicators named NinjaTrader Spotter that comes default with NinjaTrader.
That said, you could use Close[int barsAgo] in your script to reference the close price of a bar. Close[0] would refer to the close price of the current bar. Close[1] would refer to the close price of the previous bar. Close[2] would refer to the close price 2 bars ago, etc.
See this help guide for more information and sample code: https://ninjatrader.com/support/help.../nt8/close.htm
To get the Stochastics K plot value in NinjaScript, you could use the following syntax.
Stochastics(int periodD, int periodK, int smooth). K[int barsAgo]
Stochastics(ISeries<double> input, int periodD, in t periodK, int smooth).K[int barsAgo]
See this help guide page for more information and sample code: https://ninjatrader.com/support/help...tochastics.htm
You could consider saving these values to double variables, then use those variables to make calculations in your script.
Let me know if I may assist further.
<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
670 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
379 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
111 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
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
582 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment