Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator works in chart but not in market analyzer

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

    Indicator works in chart but not in market analyzer

    Hello
    I developed an indicator, which works fine in a chart and displays correctly.
    In the indicator I check whether a minimum number of bars has passed, if not, I print -1. And this value I see in the market analyzer.
    I checked the code of SMA, which has the same principle (needs to check for a minimum number of bars). SMA works in the market analyzer.

    What am I doing wrong?

    thanks & regards
    andre

    #2
    Hello,

    Did you make sure to select the correct plot when you added the indicator to the Market Analyzer as I show in the attached image?

    Also did you set the correct time frame for the Market Analyzer to calculate on? This would need to be set the same as the chart that the indicator works on. So if you have the indicator working on a 1 min chart you would need to set the Market Analyzer for calculate the indicator based on 1 min chart. Also are you sure that you have data for the instrument you are calculating on in the MA?


    If you are still unable to get this indicator to work in the Market Analyzer please let me know if you are running NT7 and NT6.5 and please goto File->Utilites->Export NinjaScript and then attach the NinjaScript file to the forum so that I may download it and they and get the indicator to run on my side.

    I look forward to assisting you further.
    Attached Files
    Last edited by NinjaTrader_Brett; 05-13-2010, 08:47 AM.

    Comment


      #3
      Hello

      Thanks for the fast reply.
      I did the checks and all seems ok.
      My indicator is very simple:
      protected override void OnBarUpdate()
      {

      if (CurrentBar>MinBars)
      {
      result= myFunction();
      Plot0.Set(result);
      }
      else Plot0.Set(-1);
      }

      I run it on a daily basis and use the same instrument as I do in the chart.
      Obviously the problem is that CurrentBar is <=MinBars, even I have historical data for years

      Comment


        #4
        Hello,

        Do you have any code above where you are checking for enough bars? As the way you are checking this does not stop the indicator from calculating its values which is what causes the error, since your code only stops the plotting if there isnt enough bars. Please see the below reference sample.

        Please try switching to the following method for checking for enough bars directly below OnBarUpdate() as shown in the following tip forum post by Josh.



        if (CurrentBar < 1)
        return;


        If this does not change the result then to do any more tesing I would need to have your code to test on my side. If your not comftorable posting to the forum you can send it as an attachment to support at ninjatrader dot com and in the subject line put in ATTN: Brett and reference this forum post.

        Also please let me know if you are seeing any errors when you add the indicator to the market analyzer in the log tab in the Control Center.

        I look forward to assisting you further.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Aviram Y, Today, 05:29 AM
        0 responses
        2 views
        0 likes
        Last Post Aviram Y  
        Started by quantismo, 04-17-2024, 05:13 PM
        3 responses
        25 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        7 responses
        34 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cls71, Today, 04:45 AM
        0 responses
        6 views
        0 likes
        Last Post cls71
        by cls71
         
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        217 views
        1 like
        Last Post PaulMohn  
        Working...
        X