Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Elder's - Force Index
Collapse
X
-
if it's just swapping EMA for SMA, then that's a 10-second fix:
tools | edit ninjascript | indicator > ForceIndex2
find lines 63-64:
change to:Code:// create SMA-Period of ForceIndex arrForceIndexPeriod.Set(SMA(arrForceIndex,Period)[0]);
hit F5 to compile and then F5 on your chart to refresh and see if that does the trick.Code:// create EMA-Period of ForceIndex arrForceIndexPeriod.Set(EMA(arrForceIndex,Period)[0]);
if that solves the "math" issue, then we'll get to the histogram
Comment
-
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,
-eAttached Files
Comment
-
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
-
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
-
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:
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:double rs = avgUp[0] / (avgDown[0] == 0 ? 1 : avgDown[0]); double rsi = 100 - (100 / (1 + rs));
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.Code:arrForceIndex.Set(Volume[0]*(Close[0]-Close[1]));
thanks,
-e
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
602 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
347 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
559 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment