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

Please Help develop indicator

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

    Please Help develop indicator

    Hi all,

    I'm trying to develop an indicator with 4 conditions. However I don't know how to string the conditions together. Here it the code and a picture of an example of what I'm trying to accomplish.




    Here is my code so far:


    #region Using declarations
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    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>
    /// plots an arrow test
    /// </summary>
    [Description("plots an arrow test")]
    public class AverageArrow : Indicator
    {
    #region Variables
    // Wizard generated variables
    private int eMAinput = 16; // Default setting for EMAinput of 16
    private int sMAinput = 13; // Default setting for SMAinput of 13
    // Color arrow
    private Color dnColor = Color.Yellow;

    #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()
    {

    CalculateOnBarClose = true;


    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // condition set 1 takes a longer EMA and lets the condition know // that it is less then (below) the shorter SMA
    if (EMA(eMAinput)[0] < SMA(SMAinput)[0])
    {
    }

    // Condition set 2 looks for a short down trend in the sma three bars back
    if (SMA(SMAinput)[3] > SMA(SMAinput)[2]
    && SMA(SMAinput)[2] > SMA(SMAinput)[1])
    {
    }

    // Condition set 3 looks for a down close candle
    if (Close[0] <= Open[0])
    {
    }

    // Condition set 4 looks for a bar high greater then .20+SMA for ES
    if (High[0] > .20+SMA(SMAinput)[0])
    {
    }

    // Condition set 5 takes all conditions and if they all equal true statements
    // it plots a downarrow above the closed bar

    if (condition1 && condition2 && condition3
    && condition4)
    {

    DrawArrowDown("My down arrow" + CurrentBar, false, 0, High[0]+1*TickSize, dnColor);
    }
    }
    #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 Plot0
    {
    get { return Values[0]; }
    }

    [Description("")]
    [Category("Parameters")]
    public int SMAinput
    {
    get { return sMAinput; }
    set { sMAinput = Math.Max(1, value); }
    }

    [XmlIgnore()]
    [Description("Color for painted region")]
    [Category("Plots")]
    public Color DnColor
    {
    get { return dnColor; }
    set { dnColor = 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 AverageArrow[] cacheAverageArrow = null;

    private static AverageArrow checkAverageArrow = new AverageArrow();

    /// <summary>
    /// plots an arrow test
    /// </summary>
    /// <returns></returns>
    public AverageArrow AverageArrow(int sMAinput)
    {
    return AverageArrow(Input, sMAinput);
    }

    /// <summary>
    /// plots an arrow test
    /// </summary>
    /// <returns></returns>
    public AverageArrow AverageArrow(Data.IDataSeries input, int sMAinput)
    {
    checkAverageArrow.SMAinput = sMAinput;
    sMAinput = checkAverageArrow.SMAinput;

    if (cacheAverageArrow != null)
    for (int idx = 0; idx < cacheAverageArrow.Length; idx++)
    if (cacheAverageArrow[idx].SMAinput == sMAinput && cacheAverageArrow[idx].EqualsInput(input))
    return cacheAverageArrow[idx];

    AverageArrow indicator = new AverageArrow();
    indicator.BarsRequired = BarsRequired;
    indicator.CalculateOnBarClose = CalculateOnBarClose;
    indicator.Input = input;
    indicator.SMAinput = sMAinput;
    indicator.SetUp();

    AverageArrow[] tmp = new AverageArrow[cacheAverageArrow == null ? 1 : cacheAverageArrow.Length + 1];
    if (cacheAverageArrow != null)
    cacheAverageArrow.CopyTo(tmp, 0);
    tmp[tmp.Length - 1] = indicator;
    cacheAverageArrow = tmp;
    Indicators.Add(indicator);

    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>
    /// plots an arrow test
    /// </summary>
    /// <returns></returns>
    [Gui.Design.WizardCondition("Indicator")]
    public Indicator.AverageArrow AverageArrow(int sMAinput)
    {
    return _indicator.AverageArrow(Input, sMAinput);
    }

    /// <summary>
    /// plots an arrow test
    /// </summary>
    /// <returns></returns>
    public Indicator.AverageArrow AverageArrow(Data.IDataSeries input, int sMAinput)
    {
    return _indicator.AverageArrow(input, sMAinput);
    }

    }
    }

    // This namespace holds all strategies and is required. Do not change it.
    namespace NinjaTrader.Strategy
    {
    public partial class Strategy : StrategyBase
    {
    /// <summary>
    /// plots an arrow test
    /// </summary>
    /// <returns></returns>
    [Gui.Design.WizardCondition("Indicator")]
    public Indicator.AverageArrow AverageArrow(int sMAinput)
    {
    return _indicator.AverageArrow(Input, sMAinput);
    }

    /// <summary>
    /// plots an arrow test
    /// </summary>
    /// <returns></returns>
    public Indicator.AverageArrow AverageArrow(Data.IDataSeries input, int sMAinput)
    {
    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.AverageArrow(input, sMAinput);
    }

    }
    }
    #endregion

    #2
    How about using bools to test for true or false.

    In Variables:

    bool condition1 = false;
    bool condition2 = false;
    bool condition3 = false;
    bool condition4 = false;

    In OnBarUpadte():

    if (EMA(eMAinput)[0] < SMA(SMAinput)[0])
    {
    condition1 = true;
    else
    condition1 = false;
    }

    or

    condition1 = EMA(eMAinput)[0] < SMA(SMAinput)[0] ? true: false;
    I believe is correct syntax.

    do the same for the others, and then:

    if (condition1 && condition2 && condition3 && condition4)
    {

    DrawArrowDown("My down arrow" + CurrentBar, false, 0, High[0]+1*TickSize, dnColor);
    }
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #3
      Thanks eDanny,

      I got the Indicator to compile but nothing shows up on my chart. I realize this situation doesn't happen much but I should at least be able to find one arrow plot. Still trying to figure out what I'm doing wrong. Thanks for the help once again.

      Code:
      #region Using declarations
      using System;
      using System.ComponentModel;
      using System.Diagnostics;
      using System.Drawing;
      using System.Drawing.Drawing2D;
      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>
          /// Enter the description of your new custom indicator here
          /// </summary>
          [Description("Arrow short for when sma13 is below the ema 16 & candle above, closing down")]
          public class ProxArrow : Indicator
          {
              #region Variables
              // Wizard generated variables
                  private int eMAinput = 16; // Default setting for EMAinput of 16
                  private int sMAinput = 13; // Default setting for SMA of 13
                  bool condition1 = false;
                  bool condition2 = false;
                  bool condition3 = false;
                  bool condition4 = false;
              // Color arrow
              private Color dnColor = Color.Yellow;
              
              #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()
              {
                  Overlay = true;
                  CalculateOnBarClose    = true;
                  
                 
              }
      
              /// <summary>
              /// Called on each bar update event (incoming tick)
              /// </summary>
              protected override void OnBarUpdate()
              {
                  /* condition set 1 takes a longer EMA and let the condition know that
                     it is less then or below the shorter SMA*/
                  if (EMA(eMAinput)[0] < SMA(SMAinput)[0] ? true : false);
                  
      
                  // Condition set 2 looks for a short down in the sma three bars back
                  if (SMA(SMAinput)[2] > SMA(SMAinput)[1]
                      && SMA(SMAinput)[1] > SMA(SMAinput)[0]? true : false);
                 
      
                  // Condition set 3 looks for a down close candle
                  if (Close[0] <= Open[0]? true : false);
      
                  // Condition set 4 looks for a bar high greater then .20+SMA for ES 
                  if (High[0] > .20+SMA(SMAinput)[0]? true : false);
      
                  /* Condition set 5 takes all conditions and if they all equal true statements
                     it plots a downarrow above the closed bar*/
                  if (condition1 && condition2 && condition3
                      && condition4)
                  {
                      DrawArrowDown("down arrow" + CurrentBar, false, 0, High[0], dnColor);
                  }
              }
              #region Properties
              
              
              [Description("EMA input")]
              [Category("Parameters")]
              public int EMAinput
              {
                  get { return eMAinput; }
                  set { eMAinput = Math.Max(1, value); }
              }
              
              [Description("SMA input")]
              [Category("Parameters")]
              public int SMAinput
              {
                  get { return sMAinput; }
                  set { sMAinput = Math.Max(1, value); }
              }
              
              [XmlIgnore()]
              [Description("Color for arrow")]
              [Category("Plots")]
              public Color DnColor
              {
                  get { return dnColor; }
                  set { dnColor = 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 ProxArrow[] cacheProxArrow = null;
      
              private static ProxArrow checkProxArrow = new ProxArrow();
      
              /// <summary>
              /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
              /// </summary>
              /// <returns></returns>
              public ProxArrow ProxArrow(int eMAinput, int sMAinput)
              {
                  return ProxArrow(Input, eMAinput, sMAinput);
              }
      
              /// <summary>
              /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
              /// </summary>
              /// <returns></returns>
              public ProxArrow ProxArrow(Data.IDataSeries input, int eMAinput, int sMAinput)
              {
                  checkProxArrow.EMAinput = eMAinput;
                  eMAinput = checkProxArrow.EMAinput;
                  checkProxArrow.SMAinput = sMAinput;
                  sMAinput = checkProxArrow.SMAinput;
      
                  if (cacheProxArrow != null)
                      for (int idx = 0; idx < cacheProxArrow.Length; idx++)
                          if (cacheProxArrow[idx].EMAinput == eMAinput && cacheProxArrow[idx].SMAinput == sMAinput && cacheProxArrow[idx].EqualsInput(input))
                              return cacheProxArrow[idx];
      
                  ProxArrow indicator = new ProxArrow();
                  indicator.BarsRequired = BarsRequired;
                  indicator.CalculateOnBarClose = CalculateOnBarClose;
                  indicator.Input = input;
                  indicator.EMAinput = eMAinput;
                  indicator.SMAinput = sMAinput;
                  indicator.SetUp();
      
                  ProxArrow[] tmp = new ProxArrow[cacheProxArrow == null ? 1 : cacheProxArrow.Length + 1];
                  if (cacheProxArrow != null)
                      cacheProxArrow.CopyTo(tmp, 0);
                  tmp[tmp.Length - 1] = indicator;
                  cacheProxArrow = tmp;
                  Indicators.Add(indicator);
      
                  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>
              /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
              /// </summary>
              /// <returns></returns>
              [Gui.Design.WizardCondition("Indicator")]
              public Indicator.ProxArrow ProxArrow(int eMAinput, int sMAinput)
              {
                  return _indicator.ProxArrow(Input, eMAinput, sMAinput);
              }
      
              /// <summary>
              /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
              /// </summary>
              /// <returns></returns>
              public Indicator.ProxArrow ProxArrow(Data.IDataSeries input, int eMAinput, int sMAinput)
              {
                  return _indicator.ProxArrow(input, eMAinput, sMAinput);
              }
      
          }
      }
      
      // This namespace holds all strategies and is required. Do not change it.
      namespace NinjaTrader.Strategy
      {
          public partial class Strategy : StrategyBase
          {
              /// <summary>
              /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
              /// </summary>
              /// <returns></returns>
              [Gui.Design.WizardCondition("Indicator")]
              public Indicator.ProxArrow ProxArrow(int eMAinput, int sMAinput)
              {
                  return _indicator.ProxArrow(Input, eMAinput, sMAinput);
              }
      
              /// <summary>
              /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
              /// </summary>
              /// <returns></returns>
              public Indicator.ProxArrow ProxArrow(Data.IDataSeries input, int eMAinput, int sMAinput)
              {
                  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.ProxArrow(input, eMAinput, sMAinput);
              }
      
          }
      }
      #endregion

      Comment


        #4
        skikg,

        Please ensure you have enough bars loaded before trying to access an index of [1]. Please see this article discussing this topic: http://www.ninjatrader-support2.com/...ead.php?t=3170
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Try changing like below. You are not setting any of the bools in that code.
          //change
          if (SMA(SMAinput)[2] > SMA(SMAinput)[1] && SMA(SMAinput)[1] > SMA(SMAinput)[0]? true : false);
          //to
          condition2 = (SMA(SMAinput)[2] > SMA(SMAinput)[1] && SMA(SMAinput)[1] > SMA(SMAinput)[0]? true : false);

          //change all others too.
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment


            #6
            Still no Luck, it compiles everytime no problem. Thanks for the help. I'll get it figured out eventually.


            Code:
            #region Using declarations
            using System;
            using System.ComponentModel;
            using System.Diagnostics;
            using System.Drawing;
            using System.Drawing.Drawing2D;
            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>
                /// Enter the description of your new custom indicator here
                /// </summary>
                [Description("Arrow short for when sma13 is below the ema 16 & candle above, closing down")]
                public class ProxArrow : Indicator
                {
                    #region Variables
                    // Wizard generated variables
                        private int eMAinput = 16; // Default setting for EMAinput of 16
                        private int sMAinput = 13; // Default setting for SMA of 13
                        bool condition1 = true;
                        bool condition2 = true;
                        bool condition3 = true;
                        bool condition4 = true;
                    // Color arrow
                    private Color dnColor = Color.Yellow;
                    
                    #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()
                    {
                        Overlay = true;
                        CalculateOnBarClose    = true;
                        
                       
                    }
            
                    /// <summary>
                    /// Called on each bar update event (incoming tick)
                    /// </summary>
                    protected override void OnBarUpdate()
                    {
                        /* condition set 1 takes a longer EMA and let the condition know that
                           it is less then or below the shorter SMA*/
                        condition1 = (EMA(eMAinput)[0] < SMA(SMAinput)[0]? true : false);
                        
            
                        // Condition set 2 looks for a short down in the sma three bars back
                        condition2 = (SMA(SMAinput)[2] > SMA(SMAinput)[1]
                            && SMA(SMAinput)[1] > SMA(SMAinput)[0]? true : false);
                       
            
                        // Condition set 3 looks for a down close candle
                        condition3 = (Close[0] <= Open[0]? true : false);
            
                        // Condition set 4 looks for a bar high greater then .20+SMA for ES 
                        condition4 = (High[0] > SMA(SMAinput)[0]? true : false);
            
                        /* Condition set 5 takes all conditions and if they all equal true statements
                           it plots a downarrow above the closed bar*/
                        if (condition1 && condition2 && condition3
                            && condition4)
                        {
                            DrawArrowDown("down arrow" + CurrentBar, true, 0, High[0], dnColor);
                        }
                    }
                    #region Properties
                    
                    
                    [Description("EMA input")]
                    [Category("Parameters")]
                    public int EMAinput
                    {
                        get { return eMAinput; }
                        set { eMAinput = Math.Max(1, value); }
                    }
                    
                    [Description("SMA input")]
                    [Category("Parameters")]
                    public int SMAinput
                    {
                        get { return sMAinput; }
                        set { sMAinput = Math.Max(1, value); }
                    }
                    
                    [XmlIgnore()]
                    [Description("Color for arrow")]
                    [Category("Plots")]
                    public Color DnColor
                    {
                        get { return dnColor; }
                        set { dnColor = 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 ProxArrow[] cacheProxArrow = null;
            
                    private static ProxArrow checkProxArrow = new ProxArrow();
            
                    /// <summary>
                    /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
                    /// </summary>
                    /// <returns></returns>
                    public ProxArrow ProxArrow(int eMAinput, int sMAinput)
                    {
                        return ProxArrow(Input, eMAinput, sMAinput);
                    }
            
                    /// <summary>
                    /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
                    /// </summary>
                    /// <returns></returns>
                    public ProxArrow ProxArrow(Data.IDataSeries input, int eMAinput, int sMAinput)
                    {
                        checkProxArrow.EMAinput = eMAinput;
                        eMAinput = checkProxArrow.EMAinput;
                        checkProxArrow.SMAinput = sMAinput;
                        sMAinput = checkProxArrow.SMAinput;
            
                        if (cacheProxArrow != null)
                            for (int idx = 0; idx < cacheProxArrow.Length; idx++)
                                if (cacheProxArrow[idx].EMAinput == eMAinput && cacheProxArrow[idx].SMAinput == sMAinput && cacheProxArrow[idx].EqualsInput(input))
                                    return cacheProxArrow[idx];
            
                        ProxArrow indicator = new ProxArrow();
                        indicator.BarsRequired = BarsRequired;
                        indicator.CalculateOnBarClose = CalculateOnBarClose;
                        indicator.Input = input;
                        indicator.EMAinput = eMAinput;
                        indicator.SMAinput = sMAinput;
                        indicator.SetUp();
            
                        ProxArrow[] tmp = new ProxArrow[cacheProxArrow == null ? 1 : cacheProxArrow.Length + 1];
                        if (cacheProxArrow != null)
                            cacheProxArrow.CopyTo(tmp, 0);
                        tmp[tmp.Length - 1] = indicator;
                        cacheProxArrow = tmp;
                        Indicators.Add(indicator);
            
                        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>
                    /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
                    /// </summary>
                    /// <returns></returns>
                    [Gui.Design.WizardCondition("Indicator")]
                    public Indicator.ProxArrow ProxArrow(int eMAinput, int sMAinput)
                    {
                        return _indicator.ProxArrow(Input, eMAinput, sMAinput);
                    }
            
                    /// <summary>
                    /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
                    /// </summary>
                    /// <returns></returns>
                    public Indicator.ProxArrow ProxArrow(Data.IDataSeries input, int eMAinput, int sMAinput)
                    {
                        return _indicator.ProxArrow(input, eMAinput, sMAinput);
                    }
            
                }
            }
            
            // This namespace holds all strategies and is required. Do not change it.
            namespace NinjaTrader.Strategy
            {
                public partial class Strategy : StrategyBase
                {
                    /// <summary>
                    /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
                    /// </summary>
                    /// <returns></returns>
                    [Gui.Design.WizardCondition("Indicator")]
                    public Indicator.ProxArrow ProxArrow(int eMAinput, int sMAinput)
                    {
                        return _indicator.ProxArrow(Input, eMAinput, sMAinput);
                    }
            
                    /// <summary>
                    /// Arrow short for when sma13 is below the ema 16 & candle above, closing down
                    /// </summary>
                    /// <returns></returns>
                    public Indicator.ProxArrow ProxArrow(Data.IDataSeries input, int eMAinput, int sMAinput)
                    {
                        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.ProxArrow(input, eMAinput, sMAinput);
                    }
            
                }
            }
            #endregion

            Comment


              #7
              skikg,

              at this point, I would try some print commands to confirm that the conditions are working.

              RJay
              RJay
              NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

              Comment


                #8
                OOPS, the syntax might be off enought in my example to cause it to not work. No way to test here right now but try this change:

                condition2 = (SMA(SMAinput)[2] > SMA(SMAinput)[1] && SMA(SMAinput)[1] > SMA(SMAinput)[0]? true : false);

                to:

                condition2 = (SMA(SMAinput)[2] > SMA(SMAinput)[1] && SMA(SMAinput)[1] > SMA(SMAinput)[0]) ? true : false;

                Problem was I copied your code before and just changed the beginning.
                eDanny
                NinjaTrader Ecosystem Vendor - Integrity Traders

                Comment


                  #9
                  you should also keep the LOG tab opened on your Control Center window, just to ensure you're not missing something
                  mrlogik
                  NinjaTrader Ecosystem Vendor - Purelogik Trading

                  Comment


                    #10
                    Hey guys, Thanks for the help. I did a test of all the conditions and it seems condition 2 is the problem.

                    OOPS, the syntax might be off enought in my example to cause it to not work. No way to test here right now but try this change:

                    condition2 = (SMA(SMAinput)[2] > SMA(SMAinput)[1] && SMA(SMAinput)[1] > SMA(SMAinput)[0]? true : false);

                    to:

                    condition2 = (SMA(SMAinput)[2] > SMA(SMAinput)[1] && SMA(SMAinput)[1] > SMA(SMAinput)[0]) ? true : false;

                    Problem was I copied your code before and just changed the beginning.
                    eDanny I tried to change to syntax and still got nothing. I'll see what else I can come up. Thanks for the help once again.

                    Comment


                      #11
                      GOT IT...

                      condition2 = (SMA(SMAinput)[Math.Min(CurrentBar, 2)] > SMA(SMAinput)[Math.Min(CurrentBar, 1)]
                      && SMA(SMAinput)[Math.Min(CurrentBar, 1)] > SMA(SMAinput)[0]? true : false);

                      Thanks all.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by TraderBCL, Today, 04:38 AM
                      2 responses
                      8 views
                      0 likes
                      Last Post TraderBCL  
                      Started by martin70, 03-24-2023, 04:58 AM
                      14 responses
                      105 views
                      0 likes
                      Last Post martin70  
                      Started by Radano, 06-10-2021, 01:40 AM
                      19 responses
                      606 views
                      0 likes
                      Last Post Radano
                      by Radano
                       
                      Started by KenneGaray, Today, 03:48 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post KenneGaray  
                      Started by thanajo, 05-04-2021, 02:11 AM
                      4 responses
                      471 views
                      0 likes
                      Last Post tradingnasdaqprueba  
                      Working...
                      X