Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Analyzer displays Close Price and Not Indicator Plot

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

    Market Analyzer displays Close Price and Not Indicator Plot

    My Indicator that I added to the Market Analyzer is displaying Closing price of the Instrument(see attachment) - dont know why Price is in the indicator part - it is not Plotting "TPS" ??

    The Indicator works in the Chart but not the Market Analyzer - am I missing something in my code specific for the market analyzer ?


    #region Variables
    // Wizard generated variables
    private int overSoldLong = 25; // Default setting for OverSoldLong
    private int overBoughtLong = 70; // Default setting for OverBoughtLong
    private int sellShort = 75; // Default setting for SellShort
    private int coverShort = 30; // Default setting for CoverShort
    private int biasLong = 0;

    // User defined variables (add any user defined variables below)
    #endregion

    protected override void Initialize()
    {

    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "TPS"));
    Overlay = false;

    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    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.
    // Do not calculate if we don't have enough bars
    if (CurrentBar < 200) return;
    double value_SMA = SMA(Close, 200)[0];
    double curr_value_RSI = RSI(Close, 2, 0)[0];
    double prev_value_RSI = RSI(Close, 2, 0)[1];
    if ((curr_value_RSI> overBoughtLong ) | (Close[0] < value_SMA) )
    {
    biasLong = 0;
    }
    if (biasLong>0 & Close[0] < Close[1] & Close[0] > value_SMA)
    {
    biasLong = biasLong + 1;
    }
    else if ((curr_value_RSI < overSoldLong) & (prev_value_RSI < overSoldLong) & (Close[0] > value_SMA) )
    {
    biasLong = 1;
    DrawLine("tag1", false, 1, prev_value_RSI, 0, curr_value_RSI, Color.LimeGreen, DashStyle.Dot, 2);
    }
    ;
    TPS.Set(biasLong);
    }

    #2
    Hello mefTrader,

    Thank you for your post.

    Your issue in the Market Analyzer is this line:

    if (CurrentBar < 200) return;

    The Market Analyzer only has a lookback of 50 bars by default. You'll need to increase this for your column to at least 200, since your SMA requires that many bars of lookback to calculate. To do so, right click > Columns > select your indicator column and change the "# of bars to look back" setting to over 200, then click OK. You should then see the correct value in the Analyzer.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thanks Kate tried that and that worked thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by westofpluto, Today, 03:55 PM
      0 responses
      5 views
      0 likes
      Last Post westofpluto  
      Started by bosajin, Today, 03:48 PM
      0 responses
      5 views
      0 likes
      Last Post bosajin
      by bosajin
       
      Started by Renorail, Today, 01:38 PM
      3 responses
      18 views
      0 likes
      Last Post Renorail  
      Started by BrianARice, Today, 01:16 PM
      0 responses
      11 views
      0 likes
      Last Post BrianARice  
      Started by Ousher, Today, 09:08 AM
      0 responses
      9 views
      0 likes
      Last Post Ousher
      by Ousher
       
      Working...
      X