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 kinfxhk, 07-13-2026, 10:18 AM
      0 responses
      58 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 09:50 AM
      0 responses
      41 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 07:21 AM
      0 responses
      46 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-11-2026, 02:11 AM
      0 responses
      37 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      157 views
      0 likes
      Last Post SalmaTrader  
      Working...
      X