Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Assign Variable on first Tick

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

    Assign Variable on first Tick

    Hi,

    I have a strategy, where I want to assign the value or price of the first tick after the strategy is put on the chart to a variable.
    I want this to happen only once.
    How to I accomplish that.

    Regards
    Last edited by keepsimple; 10-17-2014, 06:01 AM.

    #2
    KeepSimple,

    You would want to use the Historical bool and another bool to detect when you are in live data and then get the first tick it will store that value and then set the bool to false.

    Example -

    if(!Historical && firstTick)
    {
    myVar = Close[0];
    firstTick = false;
    }
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Cal,

      this should work.

      Regards

      Comment

      Latest Posts

      Collapse

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