Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to reference value later on in strategy

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

    How to reference value later on in strategy

    Hello
    I am wondering how to reference a certain value/ point on chart later on in a strategy/ ninjascript. Say a defined condition happens and you want to "bookmark" a certain value and reference it later. How would you do that? thanks

    #2
    Hello behindthewheel,

    Thanks for your post.

    You could check CurrentBar to see the bar index when this occurred and assign the value to a variable. If you need to reference that bar later on in the script, you can use a BarsAgo reference like the following: Close[CurrentBar - YourVariable] (This will return the Close price for when you gave YourVariable a value.)

    We look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      I figure the simplest way to do this is assign the value to a variable. I don't see the need for the BarsAgo reference for the question as stated.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by usazencort, Today, 01:16 AM
      0 responses
      1 view
      0 likes
      Last Post usazencort  
      Started by kaywai, 09-01-2023, 08:44 PM
      5 responses
      603 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by xiinteractive, 04-09-2024, 08:08 AM
      6 responses
      22 views
      0 likes
      Last Post xiinteractive  
      Started by Pattontje, Yesterday, 02:10 PM
      2 responses
      21 views
      0 likes
      Last Post Pattontje  
      Started by flybuzz, 04-21-2024, 04:07 PM
      17 responses
      230 views
      0 likes
      Last Post TradingLoss  
      Working...
      X