Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TradeCollection Class

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

    TradeCollection Class

    In the TradeCollection Class documentation there is the following line;
    "You can access a trade object by providing an index value. Index value are zero based meaning the most recent trade taken in a strategy will be at an index value of zero."
    Should that not read as follows: "...the most recent trade taken in a strategy will be at an index value of the number of trades in a collection - 1.

    Then there is the following sample code;
    Trade firstTrade = Performance.AllTrades[0];
    Trade lastTrade = Performance.AllTrades[Performance.AllTrades.Count - 1];
    This sample code appears to be back to front, or the description at the top should be changed as per my suggestion above.

    If the most recent trade has an index value of zero, then the variable in the sample code called "firstTrade" should not be assigned the value of Performance. AllTrades[0]. And the lastTrade variable should have the zero index value assigned to it.

    Please confirm.
    Last edited by astrolobe; 09-20-2009, 06:42 PM.

    #2
    astrolobe, thanks for the pointer - you're correct those are reverse indexed meaning the first trade is at 0 the most recent one at Performance.RealtimeTrades.Count - 1.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X