Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Switching a chart

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

    Switching a chart

    Hello,

    I'm in this situation:

    I have a workspace called FOREX:
    I've got Market Analyzer on with forex pairs, and a chart.

    You can switch quickly with swift+f3 to another workspace, but how do you switch quickly to the next chart (in my situation to the next forex pair).

    Can I link them with Market Analyzer? So that I click on a symbol in Market Analyzer and the chart switch to the next symbol...

    So far I only know that I can switch in this way by just typing the symbol in the chart.

    Is there a faster way to do this? Thanks!!

    #2
    no111, set up the charts with the same link color as the Market Analyzer window and then just click the pair in the MA and NT would switch open charts to this linked symbol then.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      no111, set up the charts with the same link color as the Market Analyzer window and then just click the pair in the MA and NT would switch open charts to this linked symbol then.
      Ok now it's working, ty.

      ( I forget to set it to MA window)

      Comment


        #4
        Again thanks, that worked.

        But when I switch from symbol to another symbol I get an error... (after switching a few times)


        This is a problem the indicator LBR310.. So I will check that out first. (the log said)
        Last edited by no111; 05-30-2010, 03:10 PM.

        Comment


          #5
          The error only occurs when I have two LBR310 indicators in one chart. For example a 15min and 60min LBR310 indicator.

          Is there a solution for this problem?
          The error I get:

          30-5-2010 23:19:44 Default Failed to restore indicator 'NinjaTrader.Indicator.LBR310'. Most likely (a) the implementation changed or (b) one or more properties have been renamed or removed or (c) the custom assembly which implements this indicator no longer is there.


          Begin of the code:
          PHP Code:
          #region Using declarations
          using System;
          using System.Diagnostics;
          using System.Drawing;
          using System.Drawing.Drawing2D;
          using System.ComponentModel;
          using System.Xml.Serialization;
          using NinjaTrader.Cbi;
          using NinjaTrader.Data;
          using NinjaTrader.Gui.Chart;
          #endregion

          // This namespace holds all indicators and is required. Do not change it.
          namespace NinjaTrader.Indicator
          {
              
          /// <summary>
              /// LBR:3/10 Oscillator
              /// </summary>
              
          [Description("LBR:3/10 Oscillator")]
              [
          Gui.Design.DisplayName("LBR310")]
              public class 
          LBR310 Indicator
              
          {
                  
          #region Variables
                  // Wizard generated variables
                      
          private int fast 3// Default setting for Fast
                      
          private int slow 10// Default setting for Slow
                      
          private int longLine 16// Default setting for LongLine
                      
          private int MoMoPeriod 40;  //Look for momentum highs
                      
          private int BarHiLo 20;  //Look for price highs
                      
          private int BarLookback 3;  //Period in which the BarHigh needs to have occurred   
                      
          private DataSeries        diff;
                      private 
          DataSeries        avg;
                  
          // User defined variables (add any user defined variables below)
                  #endregion

                  /// <summary>
                  /// This method is used to configure the indicator and is called once before any bar data is loaded.
                  /// </summary>
                  
          protected override void Initialize()
                  {
                      
          Add(new Plot(Color.DarkOrangePlotStyle.Line"OscLine"));
                      
          Add(new Plot(Color.CornflowerBluePlotStyle.Bar"OscBarUP"));
                      
          Add(new Plot(Color.MaroonPlotStyle.Bar"OscBarDn"));
                      
          Add(new Plot(Color.LimePlotStyle.Line"HPLineUp"));
                      
          Add(new Plot(Color.DarkVioletPlotStyle.Line"HPLineDn"));
                      
          Add(new Line(Color.LightGray0"ZeroLine"));
                      
                      
          diff                = new DataSeries(this);
                      
          avg                    = new DataSeries(this);
                      
                      
          CalculateOnBarClose    false;
                      
          DrawOnPricePanel    false;
                      
          Overlay                false;
                      
          PriceTypeSupported    false;
                  }

                  
          /// <summary>
                  /// Called on each bar update event (incoming tick)
                  /// </summary> 
          Last edited by no111; 05-30-2010, 03:30 PM.

          Comment


            #6
            Does anybody has a solution for this? thank you


            Last part of the indicator:

            PHP Code:
                    protected override void OnBarUpdate()
                    {
                        
            // Use this method for calculating your indicator values. Assign a value to each
                        // plot below by replacing 'Close[0]' with your own formula.
                        
                        
            double FastAvg SMA(Closefast)[0];
                        
            double SlowAvg SMA(Closeslow)[0];
                        
                        
            double Difference = (FastAvg SlowAvg) / TickSize;
                                    
                        
            diff.Set((FastAvg SlowAvg) / TickSize);
                        
                        
            double Average SMA(difflongLine)[0];
                        
                        
            avg.Set(SMA(difflongLine)[0]);
                        
                        
            OscLinePlot.Set(Difference);
                        Print(
            High "     " CurrentBar);
                        if (
            Rising(diff))
                            
            OscBarUpPlot.Set(Difference);
                        else
                            
            OscBarDnPlot.Set(Difference);
                        
                        if ((
            HighestBar(diffMoMoPeriod) == && HighestBar(HighBarHiLo) <= BarLookback) || (LowestBar(diffMoMoPeriod) == && LowestBar(LowBarHiLo) <= BarLookback))
            //                DrawDot("Up Dot" + CurrentBar, 0, Difference, Color.Lime);
                            
            DrawDot("Up Dot" CurrentBartrue0DifferenceColor.Lime);
                        
                        if (
            Rising(avg))
                        {
                            
            HPLinePlotUp.Set(1avg[1]);
                            
            HPLinePlotUp.Set(Average);
                        }
                        else if (
            Falling(avg))
                        {
                            
            HPLinePlotDn.Set(1avg[1]);
                            
            HPLinePlotDn.Set(Average);
                        }
                        
                    }

                    
            #region Properties
                    
            [Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                    
            [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                    
            public DataSeries OscLinePlot
                    
            {
                        
            get { return Values[0]; }
                    }

                    [
            Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                    
            [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                    
            public DataSeries OscBarUpPlot
                    
            {
                        
            get { return Values[1]; }
                    }

                    [
            Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                    
            [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                    
            public DataSeries OscBarDnPlot
                    
            {
                        
            get { return Values[2]; }
                    }
                    
                    [
            Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                    
            [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                    
            public DataSeries HPLinePlotUp
                    
            {
                        
            get { return Values[3]; }
                    }

                    [
            Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
                    
            [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
                    
            public DataSeries HPLinePlotDn
                    
            {
                        
            get { return Values[4]; }
                    }
                    
                    [
            Description("Fast Avg")]
                    [
            Category("Parameters")]
                    public 
            int Fast
                    
            {
                        
            get { return fast; }
                        
            set fast Math.Max(1value); }
                    }

                    [
            Description("Slow Avg")]
                    [
            Category("Parameters")]
                    public 
            int Slow
                    
            {
                        
            get { return slow; }
                        
            set slow Math.Max(1value); }
                    }

                    [
            Description("HP Avg")]
                    [
            Category("Parameters")]
                    public 
            int LongLine
                    
            {
                        
            get { return longLine; }
                        
            set longLine Math.Max(1value); }
                    }
                    
            #endregion
                
            }
            }

            #region NinjaScript generated code. Neither change nor remove.
            // This namespace holds all indicators and is required. Do not change it.
            namespace NinjaTrader.Indicator
            {
                public 
            partial class Indicator IndicatorBase
                
            {
                    private 
            LBR310[] cacheLBR310 null;

                    private static 
            LBR310 checkLBR310 = new LBR310();

                    
            /// <summary>
                    /// LBR:3/10 Oscillator
                    /// </summary>
                    /// <returns></returns>
                    
            public LBR310 LBR310(int fastint longLineint slow)
                    {
                        return 
            LBR310(InputfastlongLineslow);
                    }

                    
            /// <summary>
                    /// LBR:3/10 Oscillator
                    /// </summary>
                    /// <returns></returns>
                    
            public LBR310 LBR310(Data.IDataSeries inputint fastint longLineint slow)
                    {
                        if (
            cacheLBR310 != null)
                            for (
            int idx 0idx cacheLBR310.Lengthidx++)
                                if (
            cacheLBR310[idx].Fast == fast && cacheLBR310[idx].LongLine == longLine && cacheLBR310[idx].Slow == slow && cacheLBR310[idx].EqualsInput(input))
                                    return 
            cacheLBR310[idx];

                        
            lock (checkLBR310)
                        {
                            
            checkLBR310.Fast fast;
                            
            fast checkLBR310.Fast;
                            
            checkLBR310.LongLine longLine;
                            
            longLine checkLBR310.LongLine;
                            
            checkLBR310.Slow slow;
                            
            slow checkLBR310.Slow;

                            if (
            cacheLBR310 != null)
                                for (
            int idx 0idx cacheLBR310.Lengthidx++)
                                    if (
            cacheLBR310[idx].Fast == fast && cacheLBR310[idx].LongLine == longLine && cacheLBR310[idx].Slow == slow && cacheLBR310[idx].EqualsInput(input))
                                        return 
            cacheLBR310[idx];

                            
            LBR310 indicator = new LBR310();
                            
            indicator.BarsRequired BarsRequired;
                            
            indicator.CalculateOnBarClose CalculateOnBarClose;
            #if NT7
                            
            indicator.ForceMaximumBarsLookBack256 ForceMaximumBarsLookBack256;
                            
            indicator.MaximumBarsLookBack MaximumBarsLookBack;
            #endif
                            
            indicator.Input input;
                            
            indicator.Fast fast;
                            
            indicator.LongLine longLine;
                            
            indicator.Slow slow;
                            
            Indicators.Add(indicator);
                            
            indicator.SetUp();

                            
            LBR310[] tmp = new LBR310[cacheLBR310 == null cacheLBR310.Length 1];
                            if (
            cacheLBR310 != null)
                                
            cacheLBR310.CopyTo(tmp0);
                            
            tmp[tmp.Length 1] = indicator;
                            
            cacheLBR310 tmp;
                            return 
            indicator;
                        }
                    }
                }
            }

            // This namespace holds all market analyzer column definitions and is required. Do not change it.
            namespace NinjaTrader.MarketAnalyzer
            {
                public 
            partial class Column ColumnBase
                
            {
                    
            /// <summary>
                    /// LBR:3/10 Oscillator
                    /// </summary>
                    /// <returns></returns>
                    
            [Gui.Design.WizardCondition("Indicator")]
                    public 
            Indicator.LBR310 LBR310(int fastint longLineint slow)
                    {
                        return 
            _indicator.LBR310(InputfastlongLineslow);
                    }

                    
            /// <summary>
                    /// LBR:3/10 Oscillator
                    /// </summary>
                    /// <returns></returns>
                    
            public Indicator.LBR310 LBR310(Data.IDataSeries inputint fastint longLineint slow)
                    {
                        return 
            _indicator.LBR310(inputfastlongLineslow);
                    }
                }
            }

            // This namespace holds all strategies and is required. Do not change it.
            namespace NinjaTrader.Strategy
            {
                public 
            partial class Strategy StrategyBase
                
            {
                    
            /// <summary>
                    /// LBR:3/10 Oscillator
                    /// </summary>
                    /// <returns></returns>
                    
            [Gui.Design.WizardCondition("Indicator")]
                    public 
            Indicator.LBR310 LBR310(int fastint longLineint slow)
                    {
                        return 
            _indicator.LBR310(InputfastlongLineslow);
                    }

                    
            /// <summary>
                    /// LBR:3/10 Oscillator
                    /// </summary>
                    /// <returns></returns>
                    
            public Indicator.LBR310 LBR310(Data.IDataSeries inputint fastint longLineint slow)
                    {
                        if (
            InInitialize && input == null)
                            throw new 
            ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

                        return 
            _indicator.LBR310(inputfastlongLineslow);
                    }
                }
            }
            #endregion 

            Comment


              #7
              For the error you cited, please try compiling all your NinjaScript files.

              For the 'red x' you got in the process of switching, please send me log / trace files via Help > Mail to Support so we could review them for insight.

              Thanks
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Okay thanks.
                I compiled everything and it was okay.

                The email support form in NT didn't work so I sent you an e-mail manually to [email protected]

                Comment


                  #9
                  Thanks got it and replied to you.
                  BertrandNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by mangel2000, Today, 01:30 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post mangel2000  
                  Started by Doxxxx, Today, 01:24 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post Doxxxx
                  by Doxxxx
                   
                  Started by ezekilany, Today, 01:10 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post ezekilany  
                  Started by usjavaburn, Today, 12:59 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post usjavaburn  
                  Started by heatherjmarshalls, Today, 12:56 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post heatherjmarshalls  
                  Working...
                  X