Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Want to test strategy based on time and fair value

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

    Want to test strategy based on time and fair value

    I've searched both the NT help files and these forums and have not found a direct answer to this question. I would like to try a strategy that says this (in pseudocode):

    At 9:29AM,
    If the S&P500 futures vs. fair value >10 points, then
    Open a long position.
    Else if the S&P500 futures vs. fair value <10 points, then
    Open a short position.

    At 9:35AM
    Close any open positions.


    So I will need the following variables:
    - Current market time (eastern)
    - The current S&P500 futures price
    - The current S&P500 fair value

    Are these variables available in a strategy?

    Thanks!
    Bryan

    #2
    Bryan,

    - Market time is local to your PC but yes, it is available in the context that you want. See Time property - http://www.ninjatrader-support.com/H...deV6/Time.html

    - Yes this is available by using Mult-time frame and instrument strategies. Your market data vendor/broker needs to support this futures contract. More information - http://www.ninjatrader-support.com/H...struments.html

    - You will need to self-calculate fair value and I suspect include some input variables to represent dividends, interest rates and any other variables that make up the formula for calculating fair value...I don't recall it off the top of my head
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks, Ray. I read that Time.html file, but I didn't quite get how to use the Strategy Wizard to say "If current time (DateTime.Now.Ticks) equals 9:29AM (Time.Ticks (9, 29, 0))"?

      Like that? Or do I need to just edit the strategy code directly?

      Comment


        #4
        Strategies in the wizard are not run by current time but by bar time. If you want to use current time then best program manually.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        580 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        335 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        102 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X