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

Multi-Time Frame Indicator Reference

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

    Multi-Time Frame Indicator Reference

    The attached indicator is attempting to use EMA's from a 3 minute time frame to filter a simple alert on one minute volume, but when I try to compile it I get a "Cannot apply indexing with[] to an expression of type 'double'"
    How do I get around this?
    TIA
    Attached Files

    #2
    Hello ECI-Ed,

    Thank you for your post.

    As you have already declared the BarsArray for the EMAs there is no need to call them as [1][0], just [0]:
    Code:
                     if (Avg < vBMinL && _emaf[0]>=_emas[0]) {
                     	    vol1col = Color.Yellow;
                     	    if (lAvg > vBMinL) {
                              PlaySound("Alert_Low_Vol.wav");
                          }
                      }
                     if (Avg < vBMinS&& _emaf[0]<_emas[0]) {
                     	    vol1col = Color.Yellow;
                     	    if (lAvg > vBMinS) {
                              PlaySound("Alert_Low_Vol.wav");
                          }
                      }
    For the Font you need to set this in the Intialize() method as the following:
    Code:
    Font textFont = new Font("Arial", 14);
    Attached is the indicator with the corrections.
    Attached Files

    Comment


      #3
      Thank you Patrick,

      That solved the compilation problem, but a new problem has appeared. The subpanel is now displaying 3 minute volume every third bar. I thought I could fix this by adding [0] after each time I called the Volume, but that hasn't fixed it. What am I missing?

      TIA

      Comment


        #4
        Hello ECI-Ed,

        Thank you for your response.

        I am not seeing the same item on my end. Can you provide a screenshot of this on your chart?

        Comment


          #5
          Sure. Attached is a screen shot of my 1 minute chart.
          Attached Files

          Comment


            #6
            Hello ECI-Ed,

            Thank you for your patience.

            Change the Vol.Set(Volume[0]); to Vol.Set(Volumes[0][0]);.

            For information on Volumes please visit the following link: http://www.ninjatrader.com/support/h...t7/volumes.htm

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kujista, Today, 06:23 AM
            4 responses
            14 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by traderqz, Yesterday, 09:06 AM
            2 responses
            16 views
            0 likes
            Last Post traderqz  
            Started by traderqz, Today, 12:06 AM
            3 responses
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by RideMe, 04-07-2024, 04:54 PM
            5 responses
            28 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by f.saeidi, Today, 08:13 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X