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, 04-24-2026, 11:07 PM
          0 responses
          21 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          121 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          175 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          92 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          134 views
          0 likes
          Last Post cmoran13  
          Working...
          X