• 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

Indicator for 2 shares

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

    Indicator for 2 shares

    Hi!

    I want to create an indicator for 2 different shares and I want to implement this indicator in a chart of another share.

    Is this possible somehow?

    Thank you!

    plizer

    #2
    Hello plizer,

    Thank you for your note.

    If you plan to do this in code you can do so by adding the two shares to your indicator code and then use their values to set the plots. Then add the indicator to your third share's chart.

    For information on multiple series in your script please visit the following link: http://ninjatrader.com/support/helpG...nstruments.htm

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Does this technique also have the possibility to add about 100 stocks? Or is it limited somehow?

      Comment


        #4
        Hello plizer,

        Thank you for your response.

        You can add as many instruments as needed, but keep in mind the data provider you connect to will likely have a limit on the number of instruments that can request data at one time. In most cases this is 100 instruments.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Thank you for the answer!

          I read alll about BarsArray now and I couldnt find some of the needed data. In the help guide are just examples to get an indicator of a BarArray, like this:
          if (CCI(20)[0] > 200 && CCI(BarsArray[1], 20)[0] > 200
          && CCI(BarsArray[2], 20)[0] > 200)

          I thought the BarArray includes the different stocks I added with all information. But I cant get the information I need.

          For example: I add 10 stocks to the list. Then the primary data is BarsArray[0], the first added stock is BarsArray[1] and so on...

          But I cant get the last Close (or High or Low) with BarsArray[1].Close[0] or the second Close with BarsArray[1].Close[1]. How can I get those information?

          I can get the CurrentAsk with BarArray[1].CurrentAsk, but I want to get all CurrentAsk in the past.

          Maybe I just dont understand the system correctly?

          Comment


            #6
            Hello plizer,

            Thank you for your response.

            You would use Closes[barsInProgress index][barsAgo index]. So the secondary bar series close before the current bar would be Closes[1][1].

            Please visit the following link for more information: http://ninjatrader.com/support/helpG...nt7/closes.htm

            For information on multiple series in your script please visit the following link: http://ninjatrader.com/support/helpG...nstruments.htm

            Please let me know if you have any questions.
            Patrick H.NinjaTrader Customer Service

            Comment


              #7
              Thank you! Sounds logical!

              Comment


                #8
                I have another question. Thank you for your time in advance.

                Besides Closes[][] I need the same for BID and ASK, but I couldnt find it in the help.

                I want to work with every stock everytime when something has changed: like the last tick, the current BID and the current ASK and the also if the volume of BID or ASK and CLOSE/last changed!

                Comment


                  #9
                  Hello plizer,

                  Thank you for your post.

                  Current Ask, Bi, Ask Volume, and Bid Volume methods (ex: GetCurrentBid()) all can have the barsInProgress index passed to them to call the various bar series inputs.

                  Please review the information under Data in the Help Guide at the following link: http://ninjatrader.com/support/helpG...currentask.htm
                  Patrick H.NinjaTrader Customer Service

                  Comment


                    #10
                    I found GetCurrentAsk() before.

                    But I dont know where I enter the data of the BarsArray. Do you have an example? How can i get the second last BID of the second stock in my list?

                    Comment


                      #11
                      Hello plizer,

                      Thank you for your response.

                      Let's say we want the second bar series bid: GetCurrentBid(1);

                      If we wanted a previous bar's bid or ask value we would need to add the Bid or Ask market data type to the script in Initialize() and then call it as you would the other added series.

                      For example in Initialize():
                      Code:
                      Add("AAPL", PeriodType.Minute, 1, MarketDataType.Bid);
                      Please make sure to review the information at the following link: http://ninjatrader.com/support/helpG...nstruments.htm
                      Patrick H.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Simon Investimens, Today, 03:26 AM
                      1 response
                      5 views
                      0 likes
                      Last Post NinjaTrader_Marco  
                      Started by fx.practic, Today, 05:15 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post fx.practic  
                      Started by guidoisot, Today, 05:03 AM
                      0 responses
                      2 views
                      0 likes
                      Last Post guidoisot  
                      Started by EnveousColnago, Yesterday, 06:58 AM
                      1 response
                      13 views
                      0 likes
                      Last Post NinjaTrader_ChrisSch  
                      Started by owreivmatot, Today, 01:38 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post owreivmatot  
                      Working...
                      X