Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Divergence indicator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Divergence indicator

    Hi, I'm not of a coder and I tried to tweak Ninjatrader Spotter NT8 for my simple stochastics bar divergence.
    So basically what I would like to achieve is finding divergence in two bars closes and the stochastics k.
    Last edited by seddka; 07-30-2022, 05:26 PM.

    #2
    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>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    672 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    379 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    111 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    577 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    582 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X