Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

converting nt7 indicator to nt8

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

    converting nt7 indicator to nt8

    Hi,

    I had this code from NT7 which I'm trying to convert to NT8 and I think I just have a little bit left to go.

    Here is the code:
    Code:
    if (SumABS > 0) DemarkREI = Sum / SumABS;
    TDREI = 100*DemarkREI;
    rei[0] = (TDREI);
    
    if (IsRising(rei))
    {
    [B]if(!wasRising) Up.Set(1,rei[1]);[/B]
    Up[0] = (TDREI);
    wasRising=true;
    }
    else
    {
    [B]if (wasRising) Down.Set(1,rei[1]);[/B]
    Down[0] = (TDREI);
    wasRising=false;
    }
    I'm not sure how to convert the 2 lines I've highlighted in BOLD. If it helps, "Up" and "Down" are from AddPlot. Could someone please help?

    Regards
    Kay Wai

    #2
    Hello kaywai,

    Thanks for your post.

    From the code breaking changes document:"The DataSeries.Set() method used to assign Data Series or Plot values has been removed and values can now be stored using a single assignment operator:"

    Reference: https://ninjatrader.com/support/help...hangesOverview

    In NinjaTrader7 you would use.Set() to assign a value to a plot. In NinjaTrader8 you just assign it directly.

    Up.Set(1,rei[1]) is setting the Plot's previous bar to the previous bar of the series rei. In NinjaTrader8 that would be Up[1] = rei[1];

    Same with the Down plot.

    Last edited by NinjaTrader_PaulH; 12-30-2021, 08:27 AM.

    Comment


      #3
      Thank you Paul! Let me try that out.

      Kay Wai

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      57 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      78 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      39 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      101 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      61 views
      0 likes
      Last Post PaulMohn  
      Working...
      X