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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X