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

Different indicator result Market analyzer Vs Chart

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

    Different indicator result Market analyzer Vs Chart

    I am having issues getting the Market analyzer and the chart to display as I want using the same indicator.


    This one works perfectly in Chart but does not display the indicator value in Market Analyzer (it displays the close price)

    In Initialize()
    Plots[0].Min = 1;

    In OnBarUpdate()
    if((Stochastics(7,13,3).K[0]) < 20)
    ABC.Set(10)



    This one works perfectly in Market analyzer but plots the 0 value on the chart that I do not want to plot.

    In Initialize()
    Plots[0].Min = 1;

    In OnBarUpdate()
    ABC.Set(0);
    if((Stochastics(7,13,3).K[0]) < 20)
    ABC.Set(10)

    I realize that I can create two versions of the indicator as a work around but is there a simple code change that I can make?

    #2
    hunter, did you provide the entire code sample? The only difference I can see between the two is the second example sets the ABC plot to 0 before it checks to see if it should set it to 10. You can remove the ABC.Set(0); line and they will behave the same.

    If there is no value set to the plot, please set it to 0 or something similar because plots with no values in spots can be troublesome when viewing the plot (in either the MA or on a chart).
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin,

      Yes that is the only difference between the two sets of code and yes that is all of the code (I have simplified it to try and identify the source of my issue).

      The ABC.Set(0) is there to ensure each bar has a value.
      BUT my expectation from the Plots[0].Min = 1; in the initialize section is that it should prevent the 0 value displaying in the chart but it still plots the 0 values.

      Comment


        #4
        hunter, please try plotting with 0 as the minimum and see if that makes the chart and Market Analyzer match up.
        AustinNinjaTrader Customer Service

        Comment


          #5
          Yes the data in both now matches but the zero values are plotting on the chart and I do not want them to. I only want to see values in the chart that are above 0

          Comment


            #6
            You would need to add a signal series then for the MarketAnalyzer that you just expose and not plot, so you can plot different values for the dataseries associated with your plot value for the charts.

            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by reynoldsn, Today, 04:40 PM
            0 responses
            2 views
            0 likes
            Last Post reynoldsn  
            Started by Philippe56140, 04-27-2024, 02:35 PM
            6 responses
            54 views
            0 likes
            Last Post bltdavid  
            Started by ETFVoyageur, Yesterday, 06:05 PM
            7 responses
            44 views
            0 likes
            Last Post ETFVoyageur  
            Started by betsuni_123, Today, 04:20 PM
            0 responses
            9 views
            0 likes
            Last Post betsuni_123  
            Started by Aquila_Welokk, 04-29-2024, 01:14 PM
            2 responses
            22 views
            0 likes
            Last Post Aquila_Welokk  
            Working...
            X