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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    47 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    23 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    33 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X