Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible to expose strategy variables to optimizer?

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

    Possible to expose strategy variables to optimizer?

    I would like to build an optimizer type that evaluates reward:risk ratios.

    In my strategy, I record the initial stop price of each entry in a list:
    Code:
    List<KeyValuePair<int, IOrder>> longStops = new List<KeyValuePair<int, IOrder>>();
    Is there any way that the optimizer can pull values out of this list, or does it only have access to the "Trades" collection?

    (I can access initial price, and profit for the trade, but not the initial stop price)

    Thanks

    #2
    Hello kbeary33,

    Yes, I believe this would be possible with some in-depth custom programming. Note that would require a bit of good understanding of the Optimization method.

    If you would like to try this you can view some code in the (My) Documents -> NinjaTrader 7 -> bin -> Custom -> Type.
    JCNinjaTrader Customer Service

    Comment


      #3
      Hi JC,

      Thanks for the reply. To clarify - I know how to write new optimizer types, and how to access the typical trade performance data using something similar to the code below:

      Code:
      public override double GetPerformanceValue(SystemPerformance systemPerformance)
      {
          return systemPerformance.LongTrades.TradesPerformance.Percent.AvgProfit;
      }

      Say that I have a collection of IOrder entries that are saved in a collection in my strategy:

      Code:
      public List<KeyValuePair<int, IOrder>> longStops = new List<KeyValuePair<int, IOrder>>();
      3 Questions:
      1) What would be the coding that I would have to use in order to access this collection from inside of the Optimizer Type?

      2) Or, more generally, how can I access any data that isn't recorded in the SystemPerformance collection?)

      3) Is it possible to modify the SystemPerformance collection to store user-defined calculations?

      Thanks
      Last edited by kbeary33; 06-19-2013, 08:32 AM.

      Comment


        #4
        Hello kbeary33,

        Unfortunately, writing custom Optimization methods would not be something that we can support.

        With that said, my initial though would be to expose the List and then override the Optimization method to be able to read your Strategy's List to be able to use it for some calculations.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by hazylizard, Today, 08:38 AM
        2 responses
        8 views
        0 likes
        Last Post hazylizard  
        Started by geddyisodin, Today, 05:20 AM
        2 responses
        17 views
        0 likes
        Last Post geddyisodin  
        Started by Max238, Today, 01:28 AM
        5 responses
        45 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by giulyko00, Yesterday, 12:03 PM
        3 responses
        13 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by habeebft, Today, 07:27 AM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_ChristopherS  
        Working...
        X