Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-TimeFrame indicator into STRATEGY

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

    Multi-TimeFrame indicator into STRATEGY

    I have an Indicator which is Multi-TimeFrame. It works Great. but one line of Code I'm trying to write is Not working.

    Code:
    	//DG Mods, Set the Regular Volume Plot Attempting Conditional Statements against Average Volume (If Current Volume Crosses Above Average Volume...Do something)
    //Set VolumePlot to Plot the Other Times Object 					
    VolumePlot.Set(Volumes[1][0]);
    					
    			//Set : If Volumes Plot is Greater than Average Volume Plot
    				if(VolumePlot[0] >= AverageVolume[0])
    				{
    						DrawDot("My dot" + CurrentBar, false, 0, Close[0] + 2 * TickSize, Color.Blue);
    					exceedVol.Set(true);
    				}
    				else
    				{	exceedVol.Set(false);	}
    Any Thoughts? Both AverageVolume and VolumePlot have already been set to MultiTimeframe and they Plot on the Chart just fine. In Fact when placed in a Chart this draws the Dot with No Problem.

    When I call it in the Strategy:
    Code:
    if( DGExpVolumeForStrategy(Color.White, 4).ExceedVol[0] )
    			DrawDot("My dot" + CurrentBar, false, 0, Close[0] + 10 * TickSize, Color.Blue);
    I don't get any dots
    Attached Files

    #2
    Hello ginx10k,

    See:
    http://www.ninjatrader.com/support/f...ad.php?t=72512
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I'm confused. I already replied to that post and apologized for my mistake. Should I copy this question into that post? Or how do I get an answer for this question

      Comment


        #4
        Hello ginx10k,

        The issue is the same issue.

        In the file that you have provided in post #1 of this thread, there is no public property for ExceedVol in the DGVolumeTester indicator.

        I have put a link to the other thread, so that you will see the issue is the same issue.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Problem NOT resolved

          OKay, I downloaded the file that I uploaded, and I see the ExceedVolume Public Property clearly written in.

          Anyone else have any suggestion as to why this might NOT work.and How to fix it?

          Comment


            #6
            ginx10k,

            That was my mistake, I was looking at the wrong file.

            Are you getting any error messages in the Log tab of the Control Center?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


              Yes the error in the Pic. So the Variable is set to public, and I just can't get it to work.

              I did upload the whole strategy and indicator, if you or anyone can see what's wrong, why it's NOT calling the indicator and drawing the DOT, please let me know.

              thanks for your help.

              WARNING. the Chart must be set to minimum 60 days. in order for the Volume indicator to show anything.

              Comment


                #8
                Hi ginx10k

                The strategy is not drawing dots and not returning a value from the indicator because the indicator is crashing.

                This is the error message you got in the Log tab. This indicator isn't running at all because its hitting a fatal error.

                The question is what object is the object being referenced that does not exist.

                I would comment out code until the error stops appearing. That can help to find the object that isn't existing.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Hello ginx10k,

                  I think I found the issue.

                  On line 169
                  DrawTextFixed("Legend", "Volume Analysis", TextPosition.TopRight, ChartControl.AxisColor, textFont, Color.Empty, Color.Empty,0);

                  and line 172
                  DrawTextFixed("Legend", "Increase Chart Lookback Period", TextPosition.TopRight, ChartControl.AxisColor, textFont, Color.Empty, Color.Empty,0);

                  You call ChartControl.AxisColor.

                  Calling ChartControl is not supported by NinjaTrader to use.

                  The error you are getting is because the indicator is not directly added to the chart.
                  So ChartControl is null.

                  If you call ChartControl when this is null you get the following error:

                  Error on calling 'OnBarUpdate' method for indicator 'DGExpVolumeForStrategy' on bar 76: Object reference not set to an instance of an object.

                  The object reference is ChartControl.

                  Check that this is not null before calling this.


                  (I was able to find this by commenting out code until the error stopped. Then I slowly added the code back until only these lines were left.)
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #10
                    Wow, its amazing how something so small could give such a headache. Thank You SO MUCH for the time to look this over. It works fine now. Much appreciated

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    558 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    324 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    101 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    545 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    547 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X