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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        59 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X