Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SystemPerformance.AllTrades not usable while running the strategy not in Chart.

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

    SystemPerformance.AllTrades not usable while running the strategy not in Chart.

    obviously I have an option to run the strategy by defining it in the Strategy tab of the control center without actually having the chart open and the strategy attached to it.
    I also have in my strategy a mechanism that changes the position qty based on the statistics of previous trades.
    I use the SystemPerformance.AllTrades to get the data of the previous trades.
    all is working well while the strategy is running on a chart, but if its running standalone , I don't get the data of the previous trades.
    I specifically load 50 days of data while defining the strategy , so in principle I should have historical trades the same way I do while running on the chart.

    Is this something known ?

    Or I really have some incorrect usage in my code ? in which case i will digg dipper .
    thanks for helping

    #2
    Hello dadarara,

    Thank you for your post.

    There is a strategy property called IncludeTradeHistoryInBacktest that is defaulted to true except for when a strategy is running on the Strategies tab of the Control Center. You will need to programmatically set this property to true in State.SetDefaults to include the trade history and have access to SystemPerformance.AllTrades when running the strategy from the Strategies tab:


    Once you have made this change, compile the script and then remove and re-add the strategy to the Strategies tab to pickup the changes.

    Please let us know if we may be of further assistance.

    Comment


      #3
      exactly what I needed ,,
      thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      52 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X