Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    30 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Working...
    X