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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    35 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    12 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X