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

Generic Indicator Overlay on price

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

    #16
    Hello outsource,

    Thank you for the reply.

    This may be done like so:

    Code:
    protected override void OnBarUpdate(){
       ...
    
       if(Values[0] == Close[0]){
    
            //do something
    
        }
       ...
    }
    Remember that you are responsible for filling the Values[] array with meaningful data. A good example would be the SMA.cs in C:\Users\<user name>\Documents\NinjaTrader 7\bin\Custom\Indicator\@SMA.cs

    This is a good example of 'filling up' the Values array.

    If we may be of any further assistance, please let us know.
    Chris L.NinjaTrader Customer Service

    Comment


      #17
      Originally posted by NinjaTrader_ChrisL View Post
      Hello outsource,

      Thank you for the reply.

      This may be done like so:

      Code:
      protected override void OnBarUpdate(){
         ...
      
         if(Values[0] == Close[0]){
      
              //do something
      
          }
         ...
      }
      Remember that you are responsible for filling the Values[] array with meaningful data. A good example would be the SMA.cs in C:\Users\<user name>\Documents\NinjaTrader 7\bin\Custom\Indicator\@SMA.cs

      This is a good example of 'filling up' the Values array.

      If we may be of any further assistance, please let us know.
      I tried it before,it doesn`t work.The code you`ve provided fires alerts non stop.Is there a real example that would really work?

      Comment


        #18
        Hello outsource,

        Thanks for the follow-up

        Can you please post your code so I may look into this further?

        I look forward to your reply.
        Chris L.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_ChrisL View Post
          Hello outsource,

          Thanks for the follow-up

          Can you please post your code so I may look into this further?

          I look forward to your reply.
          Ok, here it is(please, check the attached):
          Attached Files

          Comment


            #20
            Originally posted by NinjaTrader_ChrisL View Post
            Hello outsource,

            Thanks for the follow-up

            Can you please post your code so I may look into this further?

            I look forward to your reply.
            Hi,Chris,

            so is there any news for that one?

            Comment


              #21
              Here's a version that will play the alert a max of 1x per bar.


              Also, there was a runtime error with the indicator trying to reference a prior bar on the first bar of the chart. That has been corrected
              Attached Files

              Comment


                #22
                Thank you for the post sbgtrading.
                Chris L.NinjaTrader Customer Service

                Comment


                  #23
                  Originally posted by sbgtrading View Post
                  Here's a version that will play the alert a max of 1x per bar.


                  Also, there was a runtime error with the indicator trying to reference a prior bar on the first bar of the chart. That has been corrected
                  Hi, sbg,

                  was not an intention to just switch alerts for each bar.The point was to get an alert when the price touches the plot line.That was the only purpose.

                  Comment


                    #24
                    I think it`s time to switch platforms and brokerage.You guys are decade too late comparing the other brokerage and platforms.Can`t even put together an indicator that been hanging here for a Decade!

                    Wish your still in the business in a couple of years from now.

                    Cheers!

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by frankthearm, Today, 09:08 AM
                    5 responses
                    14 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by jeronymite, 04-12-2024, 04:26 PM
                    3 responses
                    43 views
                    0 likes
                    Last Post jeronymite  
                    Started by yertle, Today, 08:38 AM
                    5 responses
                    15 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by adeelshahzad, Today, 03:54 AM
                    3 responses
                    19 views
                    0 likes
                    Last Post NinjaTrader_BrandonH  
                    Started by bill2023, Yesterday, 08:51 AM
                    6 responses
                    27 views
                    0 likes
                    Last Post NinjaTrader_Erick  
                    Working...
                    X