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.

    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.DarkOrange, PlotStyle.Line, "OscLine"));
                      Add(new Plot(Color.CornflowerBlue, PlotStyle.Bar, "OscBarUP"));
                      Add(new Plot(Color.Maroon, PlotStyle.Bar, "OscBarDn"));
                      Add(new Plot(Color.Lime, PlotStyle.Line, "HPLineUp"));
                      Add(new Plot(Color.DarkViolet, PlotStyle.Line, "HPLineDn"));
                      Add(new Line(Color.LightGray, 0, "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(Close, fast)[0];
                        double SlowAvg = SMA(Close, slow)[0];
                        
                        double Difference = (FastAvg - SlowAvg) / TickSize;
                                    
                        diff.Set((FastAvg - SlowAvg) / TickSize);
                        
                        double Average = SMA(diff, longLine)[0];
                        
                        avg.Set(SMA(diff, longLine)[0]);
                        
                        OscLinePlot.Set(Difference);
                        Print(High + "     " + CurrentBar);
                        if (Rising(diff))
                            OscBarUpPlot.Set(Difference);
                        else
                            OscBarDnPlot.Set(Difference);
                        
                        if ((HighestBar(diff, MoMoPeriod) == 0 && HighestBar(High, BarHiLo) <= BarLookback) || (LowestBar(diff, MoMoPeriod) == 0 && LowestBar(Low, BarHiLo) <= BarLookback))
            //                DrawDot("Up Dot" + CurrentBar, 0, Difference, Color.Lime);
                            DrawDot("Up Dot" + CurrentBar, true, 0, Difference, Color.Lime);
                        
                        if (Rising(avg))
                        {
                            HPLinePlotUp.Set(1, avg[1]);
                            HPLinePlotUp.Set(Average);
                        }
                        else if (Falling(avg))
                        {
                            HPLinePlotDn.Set(1, avg[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(1, value); }
                    }
            
                    [Description("Slow Avg")]
                    [Category("Parameters")]
                    public int Slow
                    {
                        get { return slow; }
                        set { slow = Math.Max(1, value); }
                    }
            
                    [Description("HP Avg")]
                    [Category("Parameters")]
                    public int LongLine
                    {
                        get { return longLine; }
                        set { longLine = Math.Max(1, value); }
                    }
                    #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 fast, int longLine, int slow)
                    {
                        return LBR310(Input, fast, longLine, slow);
                    }
            
                    /// <summary>
                    /// LBR:3/10 Oscillator
                    /// </summary>
                    /// <returns></returns>
                    public LBR310 LBR310(Data.IDataSeries input, int fast, int longLine, int slow)
                    {
                        if (cacheLBR310 != null)
                            for (int idx = 0; idx < cacheLBR310.Length; idx++)
                                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 = 0; idx < cacheLBR310.Length; idx++)
                                    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 ? 1 : cacheLBR310.Length + 1];
                            if (cacheLBR310 != null)
                                cacheLBR310.CopyTo(tmp, 0);
                            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 fast, int longLine, int slow)
                    {
                        return _indicator.LBR310(Input, fast, longLine, slow);
                    }
            
                    /// <summary>
                    /// LBR:3/10 Oscillator
                    /// </summary>
                    /// <returns></returns>
                    public Indicator.LBR310 LBR310(Data.IDataSeries input, int fast, int longLine, int slow)
                    {
                        return _indicator.LBR310(input, fast, longLine, slow);
                    }
                }
            }
            
            // 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 fast, int longLine, int slow)
                    {
                        return _indicator.LBR310(Input, fast, longLine, slow);
                    }
            
                    /// <summary>
                    /// LBR:3/10 Oscillator
                    /// </summary>
                    /// <returns></returns>
                    public Indicator.LBR310 LBR310(Data.IDataSeries input, int fast, int longLine, int 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(input, fast, longLine, slow);
                    }
                }
            }
            #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

              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.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NullPointStrategies, Today, 05:17 AM
                  0 responses
                  50 views
                  0 likes
                  Last Post NullPointStrategies  
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  126 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  69 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  42 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  46 views
                  0 likes
                  Last Post TheRealMorford  
                  Working...
                  X