• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Portfolio performance

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

    Portfolio performance

    Hi

    I want to check the performance of a portfolio of stocks using different stop criteria.

    What are the options for creating the list of stocks?

    Creating a data series for say 30 stocks seems a very clumsy way to go about it.

    I want to hold the same stocks, but would buy / sell periodically so need to lookup closing prices for various dates.

    Thanks for any pointers.

    Ian

    #2
    Hello Ianc28,

    Thanks for your message.

    You could create an Instrument List comprising of your stocks. The Instrument List can then be conveniently loaded into a Market Analyzer to see the Last Price or the Last Close of each stock.

    Instrument Lists can also be used in the Strategy Analyzer to give a basket test of those instruments with your particular strategy. I.E. if you have a few different strategies defining your stop criteria, you could run a basket test of those strategies against you instrument list to see the trade performance from tha backtest.

    If you have any additional questions, could you elaborate on your intentions and your goals so we can provide further insight?

    Working with Instrument Lists - https://ninjatrader.com/support/help...ment_lists.htm

    Basket tests - https://ninjatrader.com/support/help...asket_test.htm

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim,

      Thanks for your suggestion.

      I can see that using Market Analyzer will allow the strategy to process each stock individually, but I want to evaluate the performance of the portfolio as a whole, so I would have to write the individual results to a file and then process the individual result files.

      Part of the process may include a re-balancing of the number of shares held in the portfolio at various stages depending on the performance of the individual stock, so the whole portfolio should really be held in memory.

      Is there a way to incorporate the Market Analyzer in the strategy so that Close values can be looked up and processed within the calculations used by the strategy?

      Thanks again

      Ian

      Comment


        #4
        Hello Ian,

        Thanks for your reply.

        I can see that using Market Analyzer will allow the strategy to process each stock individually, but I want to evaluate the performance of the portfolio as a whole, so I would have to write the individual results to a file and then process the individual result files.
        You could create your own Market Analyzer column that writes this information to a file so it can be read at a later by your strategy, or you could consider writing the information to static variables in an AddOn that the strategy then reads.

        Part of the process may include a re-balancing of the number of shares held in the portfolio at various stages depending on the performance of the individual stock, so the whole portfolio should really be held in memory.
        Writing the information to static variables in an AddOn would keep the values in memory, but we are beginning to get into unsupported territory for how this could be worked into a solution for your needs. I'm not sure how you plan to do the rebalancing, and it may take some experimentation to be able to perform the rebalancing when it is needed as the backtest is performed.

        Is there a way to incorporate the Market Analyzer in the strategy so that Close values can be looked up and processed within the calculations used by the strategy?
        The best suggestion I would have would be to create your own Market Analyzer Columns that store this information in an AddOn or have the values written to file so they can be parsed by the strategy.

        An example for storing variables in an AddOn so the values can shared between scripts is linked below.

        https://ninjatrader.com/support/foru...ument-backtest

        MarketAnalyzerColumn documentation can be found here - https://ninjatrader.com/support/help...zer_column.htm

        Example indicators that incorporate a StreamWriter and StreamReader can be found below.

        SampleStreamReader - https://ninjatrader.com/support/help...o_read_fro.htm

        SampleStreamWriter - https://ninjatrader.com/support/help...o_write_to.htm

        I look forward to being of further assistance.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by chrismcdermut, Today, 01:46 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by dpolyakov, Today, 01:13 PM
        3 responses
        14 views
        0 likes
        Last Post dpolyakov  
        Started by tjendra, Today, 12:15 PM
        3 responses
        9 views
        0 likes
        Last Post tjendra
        by tjendra
         
        Started by lunardiplomacy, Today, 11:46 AM
        4 responses
        16 views
        0 likes
        Last Post lunardiplomacy  
        Started by trdninstyle, Today, 10:38 AM
        2 responses
        17 views
        0 likes
        Last Post trdninstyle  
        Working...
        X