Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Optimization Type for performance of last 'n' trades

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

    Optimization Type for performance of last 'n' trades

    Hello NinjaTraders,

    I have a strategy that requires optimization based on the performance of the most recent set of trades only. I'm trying to write an optimization type that accommodates this, but before I do could someone please answer:

    a) is it possible to pass in a variable to the optimization type code that allows you to specify the number of most recent trades to account for in the fitness test? Or must this number be hard-coded? (I'm fine with either way)

    b) What's the best approach to getting the performance of the last N trades? Is there a pre-defined method that can be used, or would I need to loop through each trade and add up the P/L for each one and do my own calculations?

    Thanks!

    -Dave

    #2
    Hello dave416,
    Thanks for your note.

    A. Yes, you can pass on a input parameter (public property) and access it from the Strategy property in the Optimization class.

    Say you have a property as MyInput then you can call it from the Optimizer as:
    Code:
    this.Strategy.MyInput
    B. You can use the TradeCollection object to retrive the trades.
    Code:
    this.Strategy.Performance.AllTrades
    Please do note the optimization class is not officially supported.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Option Whisperer, Today, 09:55 AM
    1 response
    11 views
    0 likes
    Last Post bltdavid  
    Started by port119, Today, 02:43 PM
    0 responses
    1 view
    0 likes
    Last Post port119
    by port119
     
    Started by Philippe56140, Today, 02:35 PM
    0 responses
    3 views
    0 likes
    Last Post Philippe56140  
    Started by 00nevest, Today, 02:27 PM
    0 responses
    2 views
    0 likes
    Last Post 00nevest  
    Started by Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,986 views
    0 likes
    Last Post rene69851  
    Working...
    X