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

    #16
    Also, it would be nice to plot the Force in a bar (histo) as there are clues to be gained from it. Thanks again e-man......hate to impose but I go in circles when it comes to coding.

    Comment


      #17
      if it's just swapping EMA for SMA, then that's a 10-second fix:

      tools | edit ninjascript | indicator > ForceIndex2

      find lines 63-64:
      Code:
                          // create SMA-Period of ForceIndex
                          arrForceIndexPeriod.Set(SMA(arrForceIndex,Period)[0]);
      change to:
      Code:
                          // create EMA-Period of ForceIndex
                          arrForceIndexPeriod.Set(EMA(arrForceIndex,Period)[0]);
      hit F5 to compile and then F5 on your chart to refresh and see if that does the trick.

      if that solves the "math" issue, then we'll get to the histogram

      Comment


        #18
        Thanks e-man....that's it!! looks almost identical to the accucharts and allowing for the fact the data is different, I would say you've got it. Thank you so much!!

        Comment


          #19
          excellent! got your other changes in:
          - added the histogram that plots the ForceIndex
          - colored histogram up-tick bars green, down-tick bars red like elder's MACD but you can set these to a neutral color if you prefer
          - allowed for you to select the PeriodType (EMA, SMA, etc.) and set it to default to EMA
          - also added an outline of the ForceIndex, but set the default color to Transparent (this is a personal preference of mine on MACD and figured i'd give you that capability if you like/need).

          so here 'tis ... enjoy,
          -e
          Attached Files

          Comment


            #20
            e-man you da bomb man!! (Randy on American Idol). Really appreciate your expertise on this. I owe you a round of golf if you ever get to Calgary! Can't figure how to load a screenshot (too big) or would attach it for you. Looks identical allowing for the different data. Thanks again e-man!

            Comment


              #21
              sounds like a plan, golfer ... i'll hit you up next time i head to the rockies!

              cheers,
              -e

              Comment


                #22
                e-man,

                Thank you for this indicator. However, there seems to be a fundamental issue with the display scaling.

                I am trying to think of a way to overcome this, but frankly do not know how.

                The issue is that in times of lower volume, the indicator will appear to flat-line near the zero-line because the actual Values for the indicator are too small vs. the historical scale.

                Any idea on how to make this more of a 0-based indicator, with a max 100/-100 setting?

                Mike

                Comment


                  #23
                  Hi Mike, you could run this through another osc like Stoch or RSI, maybe also apply Ehlers Fisher Transform to it to normalize.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #24
                    hey Mike,

                    good point on the change needed ... i was looking thru the code for RSI like Bertrand suggested, and these two lines seem to do the magic:

                    Code:
                                double rs      = avgUp[0] / (avgDown[0] == 0 ? 1 : avgDown[0]);
                                double rsi      = 100 - (100 / (1 + rs));
                    i compared it to Stochastics, and there is some similar code in there as well ... so if i'm understanding your suggestion, we would need to "normalize the range" of the volume bars (histogram up/down) ... only problem there is that the math behind it is:

                    Code:
                    arrForceIndex.Set(Volume[0]*(Close[0]-Close[1]));
                    if you compare this to a MACD for example, the math behind the histogram there is the difference of a couple EMAs ... so it's post-processed data, if you will ... haven't had a chance to really think thru this, but figured i'd post my initial thoughts to see if anyone else wanted to weigh in on next steps.

                    thanks,
                    -e

                    Comment


                      #25
                      Has anyone been able to have the Force Index scale in a better fashion?
                      John

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Jonker, Today, 01:19 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post Jonker
                      by Jonker
                       
                      Started by futtrader, Today, 01:16 PM
                      0 responses
                      5 views
                      0 likes
                      Last Post futtrader  
                      Started by Segwin, 05-07-2018, 02:15 PM
                      14 responses
                      1,790 views
                      0 likes
                      Last Post aligator  
                      Started by Jimmyk, 01-26-2018, 05:19 AM
                      6 responses
                      838 views
                      0 likes
                      Last Post emuns
                      by emuns
                       
                      Started by jxs_xrj, 01-12-2020, 09:49 AM
                      6 responses
                      3,294 views
                      1 like
                      Last Post jgualdronc  
                      Working...
                      X