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

how to program this feature

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

    how to program this feature

    See pics below..

    i try to use linearregslope but i don't know if is correct....

    the lines should be narrow and flat

    Do you have any idea?

    Thanks
    Attached Files

    #2
    Turbofib,

    What are currently using to calculate these out?

    What exactly are you trying to achieve?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Cal View Post
      Turbofib,

      What are currently using to calculate these out?

      What exactly are you trying to achieve?
      I want to determine the flat area where the averages are narrow and have no direction ...

      I do not know how to program this feature

      Code:
       double value1 = SMA(20)[0];
       double value2 = SMA(10)[0];
      when value1 and value2 are narrow and have no direction...

      Comment


        #4
        Tubrofib,

        There's two ways you can approach this.

        The first is to calculate the distance between the two moving averages. Smaller numbers would mean that the averages are closer together.

        The other option is to calculate the Slope() of each average and use the value to determine the your flatness.
        http://www.ninjatrader.com/support/h...html?slope.htm
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Cal View Post
          Tubrofib,

          There's two ways you can approach this.

          The first is to calculate the distance between the two moving averages. Smaller numbers would mean that the averages are closer together.



          The other option is to calculate the Slope() of each average and use the value to determine the your flatness.
          http://www.ninjatrader.com/support/h...html?slope.htm
          There is a problem...if i want to automate the algorithm for all futures and stock..



          But each stock or futures has its own scale ... so
          example :

          xg [n] -xg [0] is different as bd [n] -bd [0 ]

          xg quote 9300 ( fut dax )

          bd quote 150 ( bund )

          and i want to do this without putting the references in quotes

          Comment


            #6
            Turbofib,

            You then need to use BarsInProgress to filter out the data and to which bars object is calling the OnBarUpdate().

            http://www.ninjatrader.com/support/h...inprogress.htm
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by turbofib View Post
              There is a problem...if i want to automate the algorithm for all futures and stock..



              But each stock or futures has its own scale ... so
              example :

              xg [n] -xg [0] is different as bd [n] -bd [0 ]

              xg quote 9300 ( fut dax )

              bd quote 150 ( bund )

              and i want to do this without putting the references in quotes
              Normalize the values by dividing by the TickSize, or some other reference measure of price, such as the ATR().

              Comment


                #8
                Originally posted by NinjaTrader_Cal View Post
                Turbofib,

                You then need to use BarsInProgress to filter out the data and to which bars object is calling the OnBarUpdate().

                http://www.ninjatrader.com/support/h...inprogress.htm
                i don't understand what i do with BarsInProgress

                Comment


                  #9
                  Originally posted by koganam View Post
                  Normalize the values by dividing by the TickSize, or some other reference measure of price, such as the ATR().
                  hi, can you tell me how i use ATR ?

                  I try it but i don't understand how i use it..

                  Thanks

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by stafe, Today, 12:34 PM
                  2 responses
                  20 views
                  0 likes
                  Last Post stafe
                  by stafe
                   
                  Started by asmmbillah, Today, 11:18 AM
                  1 response
                  17 views
                  0 likes
                  Last Post NinjaTrader_ChrisL  
                  Started by nickse2003, Today, 09:56 AM
                  1 response
                  27 views
                  0 likes
                  Last Post NinjaTrader_ChristopherJ  
                  Started by ATMtrader0001, Today, 10:08 AM
                  5 responses
                  37 views
                  0 likes
                  Last Post ATMtrader0001  
                  Started by WHICKED, Today, 09:47 AM
                  1 response
                  26 views
                  0 likes
                  Last Post NinjaTrader_Spencer  
                  Working...
                  X