Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

I think I broke it!

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

    I think I broke it!

    I am trying to get an indicator to plot down into the 2nd panel. I just need this on panel two. http://screencast.com/t/11DSw0azGAYf

    This may sound like a simple task however the indicator already is drawing some invisible objects on the screen to get these Dots. So I can't attached it to my panel two because I'm drawn them through a list of a class created and called by the indicator.

    So then I went and referenced all my variables to another indicator which I couldn't get to work and make the reference calls due to it saying
    Code:
    indicator.name new reference;
    in my variables was a method being used like a type.
    So then I tried to link the list of a class to a strategy. I got that to work but it had a HEART ATTACK when I applied it to my charts.
    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


    Code:
    namespace NinjaTrader.Strategy
    {
        /// <summary>
        /// plots horizons
        /// </summary>
        [Description("plots horizons")]
        public class APAhorizonplots : Strategy
        {
    		#region Variables
           	Indicator.APAHorizon horizon;
    		
    		public int strength = 4;
    		public int dz = 3;
    		
    		//public List<APAHorizon.confluencetime> Master;
    		
    		
            #endregion
    		
             protected override void Initialize()
            {
               // Master = new List<APAHorizon.confluencetime>();
               
    			horizon = APAHorizon(dz, strength);
                            
    			
    			
            }
    		 protected override void OnStartUp()
            {
    		 	horizon.Input = BarsArray[0];
    			
    		}
           
           protected override void OnBarUpdate()
            {
    				//brings over the list class from the indicator
    				List<APAHorizon.confluencetime> DisplayML = horizon.GetMasterSortedlist();  
    				APAHorizon.confluencetime DisplayMasterPlot = horizon.GetLastMasterSortedlist();  
    				
    				//checks for null
    				if(DisplayMasterPlot == null)
    				{
    					Print("Take Off you hoser");
    					return;
    				}
    				else
    				{
    					foreach(APAHorizon.confluencetime row in DisplayML)
    					{
    										
    						Print("MasterList:  Time "+row.day+" total count : "+row.count);
    						Font labelFont = new Font("Arial", 8.0f, FontStyle.Bold);
    						Color cc = Getconfluencecolor(row.count);
    						
    						DrawDot("futureplot"+row.day, true, row.day, Close[0], cc);
    						DrawText("Date of Instance"+row.day,true, ""+row.day.ToShortDateString(), row.day, 0,0, cc, labelFont ,StringAlignment.Center, Color.Transparent, Color.Transparent,0);
    					}
    //				}
    			
    		}
        private Color Getconfluencecolor(int count)
    		{
    			switch(count)
    						{
    							case 0:
    								return Color.Blue;
    							
    							case 1:
    								return Color.Orange;
    															
    							case 2:
    								return Color.Red;
    								
    							case 3:
    								return Color.Green;
    							
    							case 4:
    								return Color.Black;
    								
    						}
    					return Color.Turquoise;
    		}
    Anyone have a clue how to get this to work?
    Last edited by APA Zones; 07-17-2012, 10:05 PM.

    #2
    Slow down, take a deep breath...

    Is this a runtime or compile time error?

    I'm going to guess runtime. I've never heard of APAxxxxxxxxxx...?

    I've google'd 5 lines of you code and can't find anything related to APA horizon...ummm




    Originally posted by doubletop View Post
    I am trying to get an indicator to plot down into the 2nd panel. I just need this on panel two. http://screencast.com/t/11DSw0azGAYf

    This may sound like a simple task however the indicator already is drawing some invisible objects on the screen to get these Dots. So I can't attached it to my panel two because I'm drawn them through a list of a class created and called by the indicator.

    So then I went and referenced all my variables to another indicator which I couldn't get to work and make the reference calls due to it saying
    Code:
    indicator.name new reference;
    in my variables was a method being used like a type.
    So then I tried to link the list of a class to a strategy. I got that to work but it had a HEART ATTACK when I applied it to my charts.
    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


    Code:
    namespace NinjaTrader.Strategy
    {
        /// <summary>
        /// plots horizons
        /// </summary>
        [Description("plots horizons")]
        public class APAhorizonplots : Strategy
        {
            #region Variables
               Indicator.APAHorizon horizon;
            
            public int strength = 4;
            public int dz = 3;
            
            //public List<APAHorizon.confluencetime> Master;
            
            
            #endregion
            
             protected override void Initialize()
            {
               // Master = new List<APAHorizon.confluencetime>();
               
                horizon = APAHorizon(dz, strength);
                            
                
                
            }
             protected override void OnStartUp()
            {
                 horizon.Input = BarsArray[0];
                
            }
           
           protected override void OnBarUpdate()
            {
                    //brings over the list class from the indicator
                    List<APAHorizon.confluencetime> DisplayML = horizon.GetMasterSortedlist();  
                    APAHorizon.confluencetime DisplayMasterPlot = horizon.GetLastMasterSortedlist();  
                    
                    //checks for null
                    if(DisplayMasterPlot == null)
                    {
                        Print("Take Off you hoser");
                        return;
                    }
                    else
                    {
                        foreach(APAHorizon.confluencetime row in DisplayML)
                        {
                                            
                            Print("MasterList:  Time "+row.day+" total count : "+row.count);
                            Font labelFont = new Font("Arial", 8.0f, FontStyle.Bold);
                            Color cc = Getconfluencecolor(row.count);
                            
                            DrawDot("futureplot"+row.day, true, row.day, Close[0], cc);
                            DrawText("Date of Instance"+row.day,true, ""+row.day.ToShortDateString(), row.day, 0,0, cc, labelFont ,StringAlignment.Center, Color.Transparent, Color.Transparent,0);
                        }
    //                }
                
            }
        private Color Getconfluencecolor(int count)
            {
                switch(count)
                            {
                                case 0:
                                    return Color.Blue;
                                
                                case 1:
                                    return Color.Orange;
                                                                
                                case 2:
                                    return Color.Red;
                                    
                                case 3:
                                    return Color.Green;
                                
                                case 4:
                                    return Color.Black;
                                    
                            }
                        return Color.Turquoise;
            }
    Anyone have a clue how to get this to work?

    Comment


      #3
      doubletop, I guess I'm not exactly sure what you're trying to do here - you can unfortunately not plot / draw to both panels from one indicator, some users found success though in using DrawOnPricePanel dynamically, however we could officially not support it.

      If you wish to access internal variables or series values of your indicator and those would not be exposed already as plots, please use the concepts of this reference sample :

      Comment


        #4
        Originally posted by sledge View Post
        Slow down, take a deep breath...

        Is this a runtime or compile time error?

        I'm going to guess runtime. I've never heard of APAxxxxxxxxxx...?

        I've google'd 5 lines of you code and can't find anything related to APA horizon...ummm
        You haven't found it because it does not exist yet. Its in Alpha/Beta. APAhorizonplot is the name of the strategy I gave it to plot in the 2nd panel.
        Thanks for the word on people that have hacked this method. I will have to make my own hack I guess. Thanks again.
        Last edited by APA Zones; 07-18-2012, 12:17 PM.

        Comment


          #5
          So I guess you have to break something before you really know what you are doing.
          The DrawOnPricePanel = false in the initialize method worked like a charm and boom I got it to work
          World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          566 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          330 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
          547 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          548 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X