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

Indicator not behaving as expected

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

    Indicator not behaving as expected

    Hi all. I'm getting started with indicator scripting today. I've got a couple compiling/ running to generate alerts, but the one that is generating alerts is giving false signals. Hopefully, it's me. My indicator is simple... I want to return "1" to fire an alert from market analyzer. I'm looking to fire it when the latest period has the lowest low in 10 periods, and a high that it higher than the 2nd latest period, with 2x the volume of the 2nd latest period. I've attached two charts that show what it fired on (2nd latest candles shown on each). The charts are on 15 min bars, same as the column in market analyzer, and they show that all my criteria aren't met. Hopefully someone can help.. Here's my main method:

    Code:
    protected override void OnBarUpdate()
     {
         if ((Low[0] < Low[1]) && (High[0] > High[1]) && (Volume[0] >= Volume[1]*2) && (MIN(Low,10)[0]==Low[0]))
             Plot0.Set(1);
         else
             Plot0.Set(0);
    }
    Attached Files

    #2
    Hello CSharpTrader,
    If you apply the indicator on the chart and on the market analyzer then do the values match?

    I look forward to assisting you further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Not sure how...

      I don't know how to do that.. if I'm not mistaken, my indicator has no graphic component... I thought I was just coding it to return 0 or 1 to be used in the alert.

      Comment


        #4
        Scratch that... I added it, I see that it does match. But at the time it fired, it was way off..

        Comment


          #5
          Hello CSharpTrader,
          Glad you could make it work.

          Unfortunately we cannot say anything for sure unless we could replicate it at our end. If you can replicate the scenario then please let us know the procedures on how to reproduce it and we will be happy to investigate it further.

          I look forward to assisting you further.
          JoydeepNinjaTrader Customer Service

          Comment


            #6
            If i can replicate it... it what sense? I can give you all the info you'd like to know. Let me ask you this... could it be getting calculated since the period bar it's firing on is getting grabbed within the lookback period? I thought lookback period had to be set to access past data properly for the script..

            Comment


              #7
              Hello CSharpTrader,
              Look back period is relevant if your indicator references to historical data for calculating the values. Please refer to this thread which discusses it in more details
              JoydeepNinjaTrader Customer Service

              Comment


                #8
                Thanks for the help.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by GLFX005, Today, 03:23 AM
                0 responses
                2 views
                0 likes
                Last Post GLFX005
                by GLFX005
                 
                Started by XXtrader, Yesterday, 11:30 PM
                2 responses
                11 views
                0 likes
                Last Post XXtrader  
                Started by Waxavi, Today, 02:10 AM
                0 responses
                7 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Started by TradeForge, Today, 02:09 AM
                0 responses
                14 views
                0 likes
                Last Post TradeForge  
                Started by Waxavi, Today, 02:00 AM
                0 responses
                3 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Working...
                X