Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to replace if (Historical) in NT8?

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

    How to replace if (Historical) in NT8?

    I have a piece of code that I got from someone else for an NT7 indicator which uses the Historical function. I'm trying to port it over to NT8 and could use some help.

    in the NT7 variables region I have the following:
    Code:
    private System.Collections.ArrayList nAsks = new System.Collections.ArrayList();
    private double nbuys = 0;
    then in the OnBarUpdate() section:
    Code:
    nAsks.Insert(Math.Max(-1, 0), Historical ? 0 : nbuys);
    when I try this code in NT8, I get the following error:
    The name 'Historical' does not exist in the current context
    If this needs to be converted into code using a State.Historical check in the OnStateChange() section, I'm really gonna need some help.


    thanks in advance!

    #2
    Hi Gubbar,

    Historical is now '(State==State.Historical)'


    Originally posted by gubbar924 View Post
    I have a piece of code that I got from someone else for an NT7 indicator which uses the Historical function. I'm trying to port it over to NT8 and could use some help.

    in the NT7 variables region I have the following:
    Code:
    private System.Collections.ArrayList nAsks = new System.Collections.ArrayList();
    private double nbuys = 0;
    then in the OnBarUpdate() section:
    Code:
    nAsks.Insert(Math.Max(-1, 0), Historical ? 0 : nbuys);
    when I try this code in NT8, I get the following error:
    If this needs to be converted into code using a State.Historical check in the OnStateChange() section, I'm really gonna need some help.


    thanks in advance!

    Comment


      #3
      worked like a charm, thank you!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      656 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      373 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      579 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X