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;
          }

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          308 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          199 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          186 views
          1 like
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          275 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          229 views
          0 likes
          Last Post CarlTrading  
          Working...
          X