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:
       [FONT=Courier New][COLOR=#0000ff]double[/COLOR] value1 = SMA(20)[0];[/FONT]
       [FONT=Courier New][COLOR=#0000ff]double[/COLOR] value2 = SMA(10)[0];[/FONT]
       [FONT=Courier New][/FONT]
      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 TraderBCL, Today, 04:38 AM
                  2 responses
                  7 views
                  0 likes
                  Last Post TraderBCL  
                  Started by martin70, 03-24-2023, 04:58 AM
                  14 responses
                  105 views
                  0 likes
                  Last Post martin70  
                  Started by Radano, 06-10-2021, 01:40 AM
                  19 responses
                  606 views
                  0 likes
                  Last Post Radano
                  by Radano
                   
                  Started by KenneGaray, Today, 03:48 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post KenneGaray  
                  Started by thanajo, 05-04-2021, 02:11 AM
                  4 responses
                  471 views
                  0 likes
                  Last Post tradingnasdaqprueba  
                  Working...
                  X