NexusFi: Find Your Edge


Home Menu

 



Categories Help    






Search Results
Submitted by DavidBodhi
Found 13 matching entries

Sort by

Entries
Wicks 5 *
It's common for people to look at how large the upper or lower 'wicks' or 'shadows' are in comparison to the range of a bar. In writing strategies that do so, I got tired of re-re-coding calculations to look for especially large ones.
So, I created an indicator that shows the upper and lower wick size as a percentage of the bar's range. So, now, if I want to specify a wick that's greater than 50% of the bar's range, I can just look for instances where the indicator values are UpperWick > 50 or LowerWick < -50.

If you find looking for negative numbers cumbersome, edit the indicator and reverse the LowerWick calculations, from either (Low[0] - Open[0]) or (Low[0] - Close[0]) to (Open[0] - Low[0]) or (Close[0] - Low[0]), respectively. Then, all the histogram bars will point upwards and you can make your code always look for positive values.

I hope some of you find this indicator handy.

I neglected to account for instances where Range() is zero, so the original indicator sometimes stops working. This newer version corrects that problem.


Category NinjaTrader 7 Indicators 
 
Suggest other entries I might like
Details: Wicks
Category: NinjaTrader 7 Indicators 


November 5th, 2017
Size: 3.29 KB
Downloaded: 171 times
True Slope Indicator V5 5 *
After explicitly and laboriously adding various moving average types, linear regression, etc. to subsequent versions of my slope angle indicator, I finally realized that, in the indicator code, Input[0] refers to whatever price or indicator data series the user puts in the "Input series" field of the indicator parameters window. Duh. I reiterate: duh.

So, in this version (V5) I removed all the explicit options and changed the code to calculate using the Input series. Now, it'll simply use the values of whatever you put in the Input series field.

What it no longer will do, however, is allow you to measure the angle between High and Low or Median and Close or whatever. Now it'll just do High to High, Low to Low, etc. I may, in the future, add back the option to choose differing price values to start and end on, but you can still use V1 for that, if desired.
Or, if someone wants to merge the two versions, feel free. Just let me know so *I* can use it!

In the screen shot, you can see two instances of it. The upper plot shows the angle between Low[3] and Low[0]. The lower plot shows the angle between SMA(50)[3] and SMA(50)[0].

I drew the vertical lines to show that the plot crosses zero, meaning a perfectly flat slope, a little later than where the SMA slope is visually flat. That's due to the period of the measurement being 3 bars. A 1 bar period shows the zero slope much closer to its real location, but you tend to get a much choppier line. Another trade-off. Still, the indicator can be useful for measuring extreme slopes or generally flat periods, which was my original intent.

I do want to mention that any negative value means slope is downward. Likewise any positive value means slope is upwards. So, even where the slope curve is rising, if it's still below zero, the slope you're measuring is descending, just not as steeply.

I hope this indicator is of some greater use to the community than V1.


Category NinjaTrader 7 Indicators 
 
Suggest other entries I might like
Details: True Slope Indicator V5
Category: NinjaTrader 7 Indicators 


October 25th, 2017
Size: 2.00 KB
Downloaded: 309 times
True Slope Indicator V1 5 *
THERE IS A NEW VERSION OF THIS INDICATOR. FIND IT AT:
https://nexusfi.com/download/ninjatrader-7/indicators/1922-download.html?view

At various times, I have wanted an indicator that showed the slope of a line between two price points on a chart. I looked here on the forum for one and found a number of people discussing it, generally attempting to measure the slope of a line they'd drawn on the chart, and realizing that, if the chart is resized in any way, the slope is changed, blowing its usability.

I finally looked at the question independent of the chart. Treating the problem as that of measuring the leftmost angle of a right triangle, with the hypotenuse formed by the price at the starting point and the price at the end point and the right angle at the lower right, I finally found a usage for the trigonometry classes I'd had.

If you know the length of two sides of a right triangle, you can calculate the angles using the inversions of the sine, cosine and tangent functions, the arcsin, the arccos and the arctangent.

Taking the difference in price between the starting bar and the ending bar, converted to ticks, as the height of the side opposite the angle and the number of bars as the length of the side parallel to the bottom of the chart, the leftmost angle can be calculated and it will stay the same regardless how the chart is resized. This gives the 'real' angle, or slope, of a line drawn from the price on the starting bar to a price on the ending bar. Fortunately, the C# programming language contains the arctan function, Atan(), so it was possible to build the math without my brain exploding.

I wrote a NinjaTrader indicator that allows you to choose whether to start on Open, Close, High, Median or Low, to choose whether to end on Open, Close, High, Median or Low and the period, or number of bars, you want to measure. I have uploaded the .cs file, zipped. Just import it, as usual. All the math is contained within the indicator.

No line is drawn on the chart (since it calculates for every bar, you'd potentially have a bazillion confusing lines). Instead a new panel is created with the angle at each bar plotted, between +90 and -90, which would be the angle if you measured price change on one bar.

The usability of this indicator is not as immediately obvious as I expected it to be. However, you can see that, where the plot makes a kind of 'plateau' or trough, price is continuing steeply up or down. With a long period, areas that are usually called 'chop' can be seen, as the angle maintains a value closer to zero.

This is not a lagging indicator, regardless how long the period is. Price movement on the current bar is immediately reflected in the angle. Relatively short periods can be used, for example, in automated trading to help guard against sudden unfavorable price spikes, an intra-day nemesis.

I have not tested moving averages of the angle, but those may also be useful, though will add a lag, of course.
(11/25/15) I have found myself using a Linear Regression Channel of the angle indicator and comparing to an LRC of price.)

I may also make an indicator that averages high-to-high, low-to-low, median-to-median and high-to-low angles in an attempt to emulate what the human brain does when we look at a chart. We see all this detailed activity, but the brain sort of fuzzes the image allowing us to immediately see, price going up, price going down, price going nowhere. Seeing the forest, rather than the trees.

If it seems to do the trick, I will post that, as well.
(11/25/15) After further exploration, I realized that the Linear Regression Channel indicator that comes with NinjaTrader does this already, and better than I could.

I hope those of you looking for an angle/slope indicator will find this of some use.

(Double-checked math. It is correct and you can use it with confidence. Understand that the 2 period minimum actually goes BACK 2 bars, so this version minimally measures 3 bars, including bar 0. 11/19/15)


Category NinjaTrader 7 Indicators 
 
Suggest other entries I might like
Details: True Slope Indicator V1
Category: NinjaTrader 7 Indicators 


November 15th, 2015
Size: 2.53 KB
Downloaded: 323 times
 



 
Category
 




© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top