Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Real Time Strategy Display on chart

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

    Real Time Strategy Display on chart

    i am trying to implement a live strategy on a chart so that i can see how it performs in real time.
    however the chart shows all the historical results also.
    how do i avoid this.
    i only want a clean chart with trades filled for the strategy in real time

    #2
    Look up historical. Add that to your code

    Comment


      #3
      thanks Sledge, could you please provide a little more detail for me

      Comment


        #4
        On my phone, but got it.

        This should do it:

        Comment


          #5
          Hello fiddy,


          Sledge is correct. Checking for historical data in a strategy, when running a backtest, will always return true.
          When running a live strategy, this property will be true until the strategy starts processing real-time data.

          Using this example below will exclude any historical data from the strategy and only process real time trades.


          Code:
          protected override void OnBarUpdate()
          {
              // Only run on real-time data
              if (Historical)
                   return;
          }
          Shawn B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          4 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Started by alifarahani, Today, 09:40 AM
          6 responses
          41 views
          0 likes
          Last Post alifarahani  
          Started by Waxavi, Today, 02:10 AM
          1 response
          20 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Working...
          X