Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Evaluating indicators on SP500 index in a multi instrument strategy

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

    Evaluating indicators on SP500 index in a multi instrument strategy

    Hi
    I was wondering how I could evaluate indicators
    on the SP500 index in a multi instrument strategy.
    Example:
    60min ES 09-09 first instrument
    SP500 as a second instrument does not work:
    Code:
     
    string secondInstrumentStr = "SP500";
    Add(secondInstrumentStr, PeriodType.Day, 1);
    as OnBarUpdate is never called

    what works is
    Code:
     
    secondInstrumentStr = "ES 09-09"; 
    Add(secondInstrumentStr, PeriodType.Minute, 960);
    but of course I can not use longer term indicators on
    a futures contract as there is only a maximum amount
    of <300 days available for each contract.

    How can I incorporate indicators on the SP500 in a
    strategy trading the ES?`

    Thx cbaer

    #2
    Hello,

    Be sure you understand this:


    Let me know if you have any more questions.
    DenNinjaTrader Customer Service

    Comment


      #3
      Hi Ben,

      of course I read the link you posted. Although one can never be sure not to have missed something.
      My question was related to using an instrument that is not
      tradable in itself like 1min ES 09-09 (tradable) with 1d SP500 (Not tradable as it is an index). As a workaround I am currently using 960min ES 09-09 bars (= 1day SP500 plus overnight data) so I guess understanding
      the very useful link below is not the issue.

      When I debug the code using SP500 1d as input I never even get a call to
      the OnBarUpdate method, so I was wondering if an index is not allowed in
      multiinstrument strategy. When using the 960m bars of ES no problem occures.
      The question arises if you have a workaround to offer for using indices for decision making in a strategy?

      Thx cbaer

      Originally posted by NinjaTrader_Ben View Post
      Hello,

      Be sure you understand this:


      Let me know if you have any more questions.

      Comment


        #4
        Hello,

        No, you can use indices in your code. As you mention you cannot trade them.

        Does your data feed support daily data? Do they support the SP500?:


        You may or may not want to use a longer min. interval if you do not have daily data.
        DenNinjaTrader Customer Service

        Comment


          #5
          Macd Color Bars...that Chang The Colors Of The Candle

          Quote:
          Originally Posted by captain rusty
          hi ben , captain rusty here, i am looking for the elusive indicator macd color bars..!!! where, when the macd is some where a round the water line, the candle is black, when the macd is up the candle is green, when the macd is down the candle is red.........for ninja trader........thank you

          hi ben , captain rusty here, i am looking for the elusive indicator macd color bars..!!! where, when the macd is some where a round the water line, the candle is black, when the macd is up the candle is green, when the macd is down the candle is red.........for ninja trader........thank you

          Comment


            #6
            captain rusty, welcome to the forums - to see some custom MACD variations, please check into this link here - http://www.ninjatrader-support2.com/...ch=MACD&desc=1

            You can create custom bar coloring in your indicators with the BarColor method - http://www.ninjatrader-support.com/H.../BarColor.html

            For general NinjaScript coding tutorials, please check this link out - http://www.ninjatrader-support.com/H...verview18.html
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rhyminkevin, Today, 04:58 PM
            1 response
            31 views
            0 likes
            Last Post Anfedport  
            Started by iceman2018, Today, 05:07 PM
            0 responses
            4 views
            0 likes
            Last Post iceman2018  
            Started by lightsun47, Today, 03:51 PM
            0 responses
            7 views
            0 likes
            Last Post lightsun47  
            Started by 00nevest, Today, 02:27 PM
            1 response
            14 views
            0 likes
            Last Post 00nevest  
            Started by futtrader, 04-21-2024, 01:50 AM
            4 responses
            49 views
            0 likes
            Last Post futtrader  
            Working...
            X