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 CarlTrading, Yesterday, 11:51 AM
          0 responses
          17 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, Yesterday, 11:48 AM
          0 responses
          22 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-25-2026, 09:53 PM
          0 responses
          17 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 03-25-2026, 09:51 PM
          0 responses
          13 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 03-23-2026, 11:13 AM
          0 responses
          20 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X