Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

What is the best way to refer to the date for the strategy input?

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

    What is the best way to refer to the date for the strategy input?

    I am a discretionary trader using a strategy to enter my trades.

    Each day I manually input two prices that the strategy uses to trade.

    For the purposes of backtesting/optimization I would like to be able to input those two prices for a series of days.

    What is the best way to do this?

    One way I came across while searching was to use the day of the year (where the first day of the calendar year is 1), but I wanted to create this post to see if that was truly the best way to go about this or if there is a more efficient solution.

    #2
    Hello WalterSkinner,

    Yes that would likely be an easy way to do that. You could make a list or array of prices and then use the day of the year as the index. Other ways would likely involve more code such as working with times or dates/loading data from file.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by inanazsocial, Today, 01:15 AM
    0 responses
    1 view
    0 likes
    Last Post inanazsocial  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    22 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Started by guillembm, Yesterday, 11:25 AM
    2 responses
    9 views
    0 likes
    Last Post guillembm  
    Started by junkone, 04-21-2024, 07:17 AM
    9 responses
    70 views
    0 likes
    Last Post jeronymite  
    Working...
    X