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

Market Analyzer displays Close Price and Not Indicator Plot

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

  • mefTrader
    replied
    Thanks Kate tried that and that worked thanks

    Leave a comment:


  • NinjaTrader_Kate
    replied
    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.

    Leave a comment:


  • 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);
    }

Latest Posts

Collapse

Topics Statistics Last Post
Started by judysamnt7, 03-13-2023, 09:11 AM
4 responses
57 views
0 likes
Last Post DynamicTest  
Started by ScottWalsh, Today, 06:52 PM
4 responses
36 views
0 likes
Last Post ScottWalsh  
Started by olisav57, Today, 07:39 PM
0 responses
7 views
0 likes
Last Post olisav57  
Started by trilliantrader, Today, 03:01 PM
2 responses
19 views
0 likes
Last Post helpwanted  
Started by cre8able, Today, 07:24 PM
0 responses
9 views
0 likes
Last Post cre8able  
Working...
X