Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical property

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

    Historical property

    Hello,

    how does the Strategy Analyzer work, if the below mentioned code is in MyStrategy? Does it have any effect on the result of backtest?

    Code:
    [FONT=Courier New][COLOR=#0000ff]protected override[/COLOR] [COLOR=#0000ff]void[/COLOR] OnBarUpdate()[/FONT] 
    [FONT=Courier New]{[/FONT] 
    [FONT=Courier New] [COLOR=#008000]// Only run on real-time data[/COLOR][/FONT] 
    [FONT=Courier New] [COLOR=#0000ff]if[/COLOR] (Historical)[/FONT] 
    [FONT=Courier New]    [COLOR=#0000ff]return[/COLOR];[/FONT] 
    [FONT=Courier New]}[/FONT]
    (I have read this help section many times, i understand it.) Thanks.

    #2
    Hello,

    Just checking, did you see this line in the help guide:
    "With a strategy, when running a backtest, this property will always return true"

    So you may want to comment that part out of your code when you backtest, depending on the result you want.
    DenNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Ben View Post
      So you may want to comment that part out of your code when you backtest, depending on the result you want.
      Thank you Ben

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      109 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      59 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      37 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      40 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      78 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X