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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    429 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    281 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    241 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    328 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    290 views
    0 likes
    Last Post CarlTrading  
    Working...
    X