Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Count only small trades results

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

    Count only small trades results

    Hi,

    I would like to count trades results during backtest but only these trades which quantity is small (for example: below 1000 units). Is it possible?

    #2
    Hello kucharek,
    Thanks for writing in and I am happy to assist you.

    Performace.AllTrades returns the TradeCollection taken by the strategy. You can further custom code it to filter is as per your desire. A basic code would look like:

    Code:
    int count = 0;
    foreach (Trade t in Performance.AllTrades)
    {
    	if (t.Entry.Quantity <= 1000)
    	{
    		count++;
    	}
    }
    Print(count);


    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ezekilany, Today, 01:10 AM
    0 responses
    3 views
    0 likes
    Last Post ezekilany  
    Started by usjavaburn, Today, 12:59 AM
    0 responses
    3 views
    0 likes
    Last Post usjavaburn  
    Started by heatherjmarshalls, Today, 12:56 AM
    0 responses
    2 views
    0 likes
    Last Post heatherjmarshalls  
    Started by Nicholewatkinsi, Yesterday, 10:53 PM
    0 responses
    6 views
    0 likes
    Last Post Nicholewatkinsi  
    Started by dward123, 01-02-2024, 09:59 PM
    4 responses
    176 views
    0 likes
    Last Post Lancer
    by Lancer
     
    Working...
    X