• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to assign current date (as default) to input?

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

    Is it possible to assign current date (as default) to input?

    in inputs, we set defaults in the top #region declaration.

    i.e.

    private int MyVar = 12;



    however, is it possible to give the variable value as default (like the number of current day).

    ie,

    private int MyVar = CurrentDayNumber(); // ===== 12, because today is 12 Jun

    #2
    Hello selnomeria,

    Thanks for opening the thread.

    This would not be possible as you would receive a compiler error when trying to initialize a variable with a method.

    I would suggest to leave a static value when initializing, and then to change the value in Initialize(), OnStartUp(), or on the first bar of OnBarUpdate().

    Please let me know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by vevbarrq, Today, 12:11 AM
    0 responses
    2 views
    0 likes
    Last Post vevbarrq  
    Started by johnnybegoode, Yesterday, 10:16 PM
    0 responses
    4 views
    0 likes
    Last Post johnnybegoode  
    Started by reedstickets, Yesterday, 07:53 PM
    0 responses
    9 views
    0 likes
    Last Post reedstickets  
    Started by Atilla, Yesterday, 04:05 PM
    0 responses
    31 views
    0 likes
    Last Post Atilla
    by Atilla
     
    Started by Displacer, Yesterday, 02:57 PM
    2 responses
    17 views
    0 likes
    Last Post Displacer  
    Working...
    X