Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get price at specified date

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

    Get price at specified date

    Hello,

    I need to store a close at a specified date (I use as input value)
    How could I do it?

    Let' say my input is: 20160808, I'm trying something like;

    if (ToDay(Time[0]) = input)
    RS.Set(Close[0]));

    but I doesn't work.

    Any hint?

    Thank very much.

    #2
    Hello MAX,

    Thanks for your post.

    I've created an example indicator that when applied to daily bars, will allow you to select in the indicator panel, a particular day to retrieve the close value of. The code will show you the elements of getting a date into Ninjascript and then using it to test against a day bar and when found to print the close value of that bar.

    Once the indicator is added to a daily bar chart, open the indicator panel and left click on the row "Search" to bring up a calendar tool that you can then use to select a date. The indicator will print to the output window (Tools>outputwindow) the close value of that day bar (assuming that day is on the chart).

    To Import
    1. Download the attached file to your desktop
    2. From the Control Center window select the menu File > Utilities > Import NinjaScript
    3. Select the downloaded file
    Attached Files

    Comment


      #3
      Thanks Paul.

      This was exactly what I was looking for.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      57 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      37 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      166 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      101 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      162 views
      2 likes
      Last Post CaptainJack  
      Working...
      X