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 rdtdale, Today, 01:02 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by alifarahani, Today, 09:40 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by RookieTrader, Today, 09:37 AM
      4 responses
      19 views
      0 likes
      Last Post RookieTrader  
      Started by PaulMohn, Today, 12:36 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by love2code2trade, 04-17-2024, 01:45 PM
      4 responses
      41 views
      0 likes
      Last Post love2code2trade  
      Working...
      X