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 pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      147 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      5 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      4 views
      0 likes
      Last Post tkaboris  
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,282 views
      0 likes
      Last Post Leafcutter  
      Working...
      X