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 Barry Milan, Yesterday, 10:35 PM
      5 responses
      16 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by DanielSanMartin, Yesterday, 02:37 PM
      2 responses
      13 views
      0 likes
      Last Post DanielSanMartin  
      Started by DJ888, 04-16-2024, 06:09 PM
      4 responses
      12 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by terofs, Today, 04:18 PM
      0 responses
      11 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by nandhumca, Today, 03:41 PM
      0 responses
      8 views
      0 likes
      Last Post nandhumca  
      Working...
      X