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

Elder's - Force Index

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

    Elder's - Force Index

    Anyone ever write this indicator ? It's =
    Today's volume x (today's close - yesterdays close )
    Smoothed by an 2 or 13 period EMA or of your choice basically .
    Plots above or below a zero line . tia

    #2
    Hi, you can take a look at the one in our sharing section - http://www.ninjatrader-support2.com/...e+index&desc=1
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand .
      Looks like the right formula .

      Comment


        #4
        Period for Force Index

        I am trading the force index on FX Sol Accucharts with the following parameters Period 8, EMA 3 and EMA 8. This combo gives excellent signals. Can anyone guide me to how I could alter the NT version of Force Index to user defined number of periods? And possibly keep it simple...I'm definitely coding challenged.
        TIA

        Comment


          #5
          Hi golfer, welcome to our support forums! You can right click on the chart and bring the 'Indicators' section up, then change the Fast / Slow MA types and periods to your needs.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Thanks for your reply Bertrand. I want to change the period of the Force Index. The formula gives you a default of 1 period. I would like this to be user adjustable. I prefer 8 periods which I currently use on Accucharts but would prefer to use NT on Gain. Changing the ma's is not the issue. Thanks.

            Comment


              #7
              is that an SMA of the previous 8 periods, upon which you apply the other two EMAs?

              Comment


                #8
                Hi E man. Not sure..I think the 8 periods are the calculation. If not, then it must be sma.I would think something like setting periods for an RSI. As I said below, I'm definately coding challenged. Any help is appreciated

                Comment


                  #9
                  reviewing the RSI code here to compare ... for the first X bars that are less than {Period}, the RSI is set to 50 (the midline) ... then on the bar that closes equal to {Period}, it initializes the down and up averages by doing an SMA on the previous {Period} bars ... and for each bar after that, it recalcs the up/down to include the latest bar and then does the other smoothing, etc.

                  here's the formula for ForceIndex:
                  Code:
                  Volume[0]*(Close[0]-Close[1]);
                  // multiply volume by the thisBarClose - lastBarClose
                  following the RSI example you cited, we would do nothing for the bars less than {Period} ... but the question becomes: what to do on the {Period} bar?
                  a) set to an SMA of the previous {Period} bars calculation;
                  b) take the sum of the volume for the last {Period} bars, multiply that by the sum of last {Period} bars close (including current bar) minus sum of the last {Period} + 1 bars, not including current bar;

                  if you're following the math on b) ... you would realize that we're canceling out all the {Period} bars except the current one and then subtracting the {Period} -1 bar (eg. if {Period} was 3, then it would be ((close[bar0]+close[bar1]+close[bar2]) - (close[bar1]+close[bar2]+close[bar3])), which is really close[bar0]-close[bar3])

                  i'll stop now ... perhaps there is a c) that i'm not understanding ... and now that i think about it, maybe a) and b) are the same thing?

                  what you're proposing is do-able, just need to understand how you want to handle those other periods.

                  Comment


                    #10
                    Hi golfer and e-man, then you just would need to code the basic force index period as a user defined input, more on this can be found here - http://www.ninjatrader-support2.com/...ead.php?t=5782

                    If this is above your coding appetite, you can always contact those NinjaScript consultants - http://www.ninjatrader.com/webnew/pa...injaScript.htm
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Thanks for your help guys. E-man, does Bertrands reply help? I looked at it the link and it seems to be what I'm after. Now, I'll put on my coding hat and see what I can do.........should prove interesting... Does this make sense to you e-man?

                      Comment


                        #12
                        yes, having period as an input parm is a given ...

                        but you still need to determine whether you want to do an SMA of the forceIndex over {Period} (as i outlined in option-a) or if you want to multiply average volume of last {Period} bars * close[bar0] - close[barX] where barX is the one prior to {Period} (as i outlined in option-b) ...

                        the SMA is probably easier/quicker, so unless you are confident you want option-b, i can throw together option-a for you and upload it later today and you can have a look ...

                        having said that, if neither option-a or option-b above are the correct "formula", then if you could suggest the correct formula, that would be helpful.

                        Comment


                          #13
                          E-man..would you mind doing the SMA version..sounds like a typical parameter and I can try it and compare to the one I'm using now.
                          Your help is greatly appreciated.

                          Comment


                            #14
                            ok...here you go. if you set the Period to 1, then it should look exactly like the regular ForceIndex.

                            let me know if changing the Period in the new indicator achieves the same effect as in accucharts.

                            and if not, could you post a screenshot that shows the ForceIndex(Period:1) and ForceIndex(Period:8)
                            Last edited by e-man; 04-30-2009, 08:33 PM.

                            Comment


                              #15
                              Hi e-man. Sorry for the delay getting back to you. I'm at work and actually had to do some.(work that is) I tried your revamped version and it is close. I did some searching and found the formula accucharts uses and it looks like they use an Ema (Force x= mov"E"). If that was an "S" it would be SMA
                              Does this help?

                              FUNCTION( price, period, volume )

                              VAR
                              force;
                              force_x;

                              BEGIN
                              IF CurrentBar < period THEN
                              RETURN;
                              ELSE
                              force = volume * (price - price[1]);
                              IF force <> NaN() THEN
                              force_x = move (force, period, 0);
                              END_IF;
                              END_IF;

                              FUNCTION = force_x;
                              END_FUNCTION

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by TheMarlin801, 10-13-2020, 01:40 AM
                              20 responses
                              3,914 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by timmbbo, 07-05-2023, 10:21 PM
                              3 responses
                              151 views
                              0 likes
                              Last Post grayfrog  
                              Started by Lumbeezl, 01-11-2022, 06:50 PM
                              30 responses
                              808 views
                              1 like
                              Last Post grayfrog  
                              Started by xiinteractive, 04-09-2024, 08:08 AM
                              3 responses
                              11 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by Johnny Santiago, 10-11-2019, 09:21 AM
                              95 responses
                              6,194 views
                              0 likes
                              Last Post xiinteractive  
                              Working...
                              X