Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OptimizationFitnesses, Limit Orders

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

    OptimizationFitnesses, Limit Orders

    I'd like to write an OptimizationFitness that shows how many trades were closed by a limit order. How do I do that (ie, is there a way to count the number of trades that were opened / closed by a particular limit order?)

    (I've written several OptimizationFitnesses (and they work well, thank you), so writing them isn't a challenge. My challenge here is to get to that particular data. In looking thru the Help Guide, I don't see how this is done. eg, I don't see this is an option in "strategy.SystemPerformance.AllTrades.
    TradesPerformance​".)

    #2
    Hello spottysallrite,

    You can use the following to select all trades where a exit limit order was used:

    Code:
    List<Trade> limitExits = strategy.SystemPerformance.AllTrades.Where(o => o.Exit.Order.OrderType == Cbi.OrderType.Limit).ToList();
    int count = limitExits.Count;

    Comment


      #3
      Nice! Works ! Thx !!!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      62 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      134 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X