Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Create new instrument / dataseries from strategy

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

    Create new instrument / dataseries from strategy

    Hi all,

    I have developed a strategy which I run across all Nasdaq 100 stocks. By doing so I have added them all into a MultiInstrumentStrategy. I apply a Trendscore indicator to them individually. Later within the strategy I add them all up to receive a TotalTrendScore (for all 100 Nasdaq stocks together). For this example lets call it "N100StocksTrendScore". Now my strategy can plot this score into the Output window.

    I also have a very sophisticated trading strategy for individual instruments. Now I would like to add the general market trend ("N100StocksTrendScore") to this strategy. I cannot load all N100 stocks again into the same strategy (due to performance issues, IB data limitations, etc.). But instead I prefer to only call a new dataseries which contains only the value "N100StocksTrendScore".

    So my question is: How can I save values from a strategy (in my example the N100StocksTrendScore) into a global variable or globally accessible dataseries?

    So that I can run the strategy on an instrument and only add:
    Add("N100StocksTrendScore", PeriodType.Daily, 1);

    Is this possible somehow? I would like to run the MultiInstrumentStrategy to update the N100StocksTrendScore value after US market close (using Yahoo), then I would like to save the value N100StocksTrendScore for usage later, disconnect and would then connect to InteractiveBrokers to trade lets say the ES 03-10 in realtime with my trading strategy (which would include the value N100StocksTrendScore) as an input parameter.

    Any help, any suggestions, any templates?

    Best regards
    wtmnn

    #2
    wtmnn, unfortunately cross strategy communication is not supported - users have found success using global variables or for example storing / retrieving the needed values from txt files.

    Comment


      #3
      Examples using global variables or example storing / retrieving the needed values

      Dear Bertrandt

      This is actually what I was asking for:
      "users have found success using global variables or for example storing / retrieving the needed values from txt files."

      How would I do this? Do you have any template strategys, forum links, examples?

      Regards
      wtmnn
      Last edited by whotookmynickname; 01-20-2010, 08:28 AM.

      Comment


        #4
        Unfortunately we cannot offer support on such techniques. What you can do is try searching around the forums for other user threads discussing how to do it.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          This is something I'd be really interested in, too! I've often wondered if I could use value in several "dependant" strategies - depending on your setup, this may save lots of resources (since not every strategy calculates similar things over and over again), which ultimately leads to more stability and reliability of NT.

          Bertrand and Josh, why can't you offer support on this? Techniques such as using global variables are also part of the programming environment of NT, after all. Sure you don't take any responsibility for users tinkering with their strategies, but you don't take any responsibility anyway

          So if you could please give a small example on how to take variables global or accessing them from elsewhere...?

          Thank you!

          n.i.n.j.n.a.

          Comment


            #6
            n.i.n.j.n.a., our support scope is for the NinjaScript language we have created in C# - sometimes we may go above this on a discretionary basis. The general framework of cross strategy communication is not supported in NinjaScript though, one potential way would be using txt files to read / write the needed values / data.

            A reference sample for this can be found here -

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, Yesterday, 10:06 AM
            0 responses
            14 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            11 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            9 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            4 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            31 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X