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 CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
236 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
150 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
162 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
243 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
198 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment