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 llanqui, Today, 10:32 AM
          0 responses
          2 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by StockTrader88, 03-06-2021, 08:58 AM
          45 responses
          3,992 views
          3 likes
          Last Post johntraderuser2  
          Started by TAJTrades, Today, 09:46 AM
          0 responses
          8 views
          0 likes
          Last Post TAJTrades  
          Started by rhyminkevin, Yesterday, 04:58 PM
          5 responses
          62 views
          0 likes
          Last Post dp8282
          by dp8282
           
          Started by realblubb, Today, 09:28 AM
          0 responses
          8 views
          0 likes
          Last Post realblubb  
          Working...
          X