Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer vs. Chart - Indicator value difference

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

    Strategy Analyzer vs. Chart - Indicator value difference

    Hello,

    I am using an indicator that returns different values in Strategy Analyzer vs. a Chart. I haven't seen this before. Can anyone explain why? Here is the indicator I'm using. I am running NT7, latest revision.

    Thanks,
    eleven
    Attached Files

    #2
    Chart produces one calculation per OnBarUpdate() and Strategy Analyzer 3 calculations per. See below. Anyone know why this is? Thanks,


    Chart
    10/6/2016 5:00:00 PM 0.129248366385535 130.1015625 0.217166822773285
    10/6/2016 6:00:00 PM 0.115674511543541 130.082589285714 0.173947704070877
    10/6/2016 7:00:00 PM 0.0965718094694987 130.065848214285 0.121239486994771
    10/6/2016 8:00:00 PM 0.068282722562296 130.045758928571 0.0606128926067532
    10/6/2016 9:00:00 PM 0.0649449419946643 130.037946428571 0.0548319913789741
    10/6/2016 10:00:00 PM 0.0646758707598875 130.040178571428 0.0543785873611457
    Strategy Analyzer
    10/6/2016 8:00:00 PM 0.0609575287446373 130.05 0.0148632812426131
    10/6/2016 8:00:00 PM 0.0509192835408671 130.018749999999 0.0103710937452609
    10/6/2016 8:00:00 PM 0.0553751410749959 130.075 0.0122656249963028
    10/6/2016 9:00:00 PM 0.0622259617093475 130.046875 0.0154882812426127
    10/6/2016 9:00:00 PM 0.0481594843860035 130.024999999999 0.00927734374530285
    10/6/2016 9:00:00 PM 0.0553751410749959 130.075 0.0122656249963028
    10/6/2016 10:00:00 PM 0.0617533526268267 130.04375 0.0152539062426128
    10/6/2016 10:00:00 PM 0.0469270544177991 130.028124999999 0.00880859374532431
    10/6/2016 10:00:00 PM 0.0564233440082735 130.06875 0.0127343749963039

    Comment


      #3
      Hello eleven,

      The script you have provided is an indicator.

      (Meaning this would need to be called from a strategy to be run in the Strategy Analyzer)

      Are you adding the strategy to a chart with the same amount of days as a Strategy Analyzer?

      Below is a link to a video I have created while testing this script.
      World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


      Attached is an export of the strategy that I used for testing the values of this indicator, as well as the output files created while testing.

      If you follow the same steps as I have in the video, are you getting different results?

      I've used diffchecker.com to compare the contents of the files and found the output to be exactly the same.
      Attached Files
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        My strategy I'm running is influenced by the date range of the data. The strategy data must start on a specific day. I found the quoted information below in the NT7 help guide.

        Before I start my strategy (live trade), I make sure the chart starts at a certain date. Is there a way to enable data range in my strategy so I don't always have to check my chart to ensure the correct start date is selected?

        Time Settings
        Different session templates as well as the date range of data being plotted can affect the
        chart display and indicator values.

        Comment


          #5
          Hello eleven,

          You can check the time and date of the first bar and last bar of historical data from OnBarUpdate with the Time[barsAgo index] value.

          You will not be able to set the date range or days to load (or any other data series parameters) from a script.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          578 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 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
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X