Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I would like to find the value of anaADXVMA for a futures contract's current and past bar. I have worked on this code, but I'm not getting the right values to get the comparison right. I want to identify chop areas. When ADXVMA looks flat, there is usually a lot of chop. So, here's what I have, but the values are not coming out right. If the current bar's ADXVMA is equal to the previous bar's ADXvma, then we have flattened. Visually, it makes sense. Mathematically, I'm not able to zero in on it due to variances between ticks and actual real value. The instrument I'm using is ZB.
Here's some output on the printouts I'm getting. Notice that current and previous bar are the same price.
Thanks
------
TickSize for ZB 06-16 Globex is 0.03125 and has 1.50514997831991 decimal places
----------------------------
5/18/2016 4:00:00 PM - Close of Bar - 163.65625
5/18/2016 4:00:00 PM - ADXVMA Now for ZB 06-16 Globex is: 163.839854496411
5/18/2016 4:00:00 PM - ADXVMA Before for ZB 06-16 Globex is: 163.864920513144
5/18/2016 4:00:00 PM - ADXVMA Level0 for ZB 06-16 Globex is: 163.65625
........
5/18/2016 4:00:00 PM - ADXVMA Now real ZB 06-16 Globex is: 163.65625
5/18/2016 4:00:00 PM - ADXVMA Before real ZB 06-16 Globex is: 163.65625
........
5/18/2016 4:00:00 PM - ADXVMA Now rounded for ZB 06-16 Globex is: 163.66
5/18/2016 4:00:00 PM - ADXVMA Before rounded for ZB 06-16 Globex is: 163.66
-------
TickSize for ZB 06-16 Globex is 0.03125 and has 1.50514997831991 decimal places
----------------------------
5/18/2016 4:10:00 PM - Close of Bar - 163.8125
5/18/2016 4:10:00 PM - ADXVMA Now for ZB 06-16 Globex is: 163.837111570806
5/18/2016 4:10:00 PM - ADXVMA Before for ZB 06-16 Globex is: 163.839854496411
5/18/2016 4:10:00 PM - ADXVMA Level0 for ZB 06-16 Globex is: 163.8125
........
5/18/2016 4:10:00 PM - ADXVMA Now real ZB 06-16 Globex is: 163.8125
5/18/2016 4:10:00 PM - ADXVMA Before real ZB 06-16 Globex is: 163.8125
........
5/18/2016 4:10:00 PM - ADXVMA Now rounded for ZB 06-16 Globex is: 163.81
5/18/2016 4:10:00 PM - ADXVMA Before rounded for ZB 06-16 Globex is: 163.81
-------
TickSize for ZB 06-16 Globex is 0.03125 and has 1.50514997831991 decimal places
----------------------------
5/18/2016 4:20:00 PM - Close of Bar - 163.75
5/18/2016 4:20:00 PM - ADXVMA Now for ZB 06-16 Globex is: 163.83211698193
5/18/2016 4:20:00 PM - ADXVMA Before for ZB 06-16 Globex is: 163.837111570806
5/18/2016 4:20:00 PM - ADXVMA Level0 for ZB 06-16 Globex is: 163.75
........
5/18/2016 4:20:00 PM - ADXVMA Now real ZB 06-16 Globex is: 163.75
5/18/2016 4:20:00 PM - ADXVMA Before real ZB 06-16 Globex is: 163.75
........
5/18/2016 4:20:00 PM - ADXVMA Now rounded for ZB 06-16 Globex is: 163.75
5/18/2016 4:20:00 PM - ADXVMA Before rounded for ZB 06-16 Globex is: 163.75
-------
TickSize for ZB 06-16 Globex is 0.03125 and has 1.50514997831991 decimal places
----------------------------
5/18/2016 4:30:00 PM - Close of Bar - 163.75
5/18/2016 4:30:00 PM - ADXVMA Now for ZB 06-16 Globex is: 163.83211698193
5/18/2016 4:30:00 PM - ADXVMA Before for ZB 06-16 Globex is: 163.83211698193
5/18/2016 4:30:00 PM - ADXVMA Level0 for ZB 06-16 Globex is: 163.75
........
5/18/2016 4:30:00 PM - ADXVMA Now real ZB 06-16 Globex is: 163.75
5/18/2016 4:30:00 PM - ADXVMA Before real ZB 06-16 Globex is: 163.75
........
1. Some indicators don't give you the previous value (if not exposed), you can verify this by
opening the databox on the chart and going over with your mouse
2. In that case, the work around could be to memorize the previous value, like
oldADXVMA = anaADXVMA(8).ADXVMA[0] at the end of your check
so at every bar, you have the old value at the beginning of your OnBarUpdae
Thanks for the help. After getting it coded it turns out what 'looks' to the eye as a neutral or choppy area, the underlying math says otherwise. So, what I really would like to know if there is a way to access the Pos, Neg, Neutral trend state in anaADXVMA indicator from the code. I can see that the series is exposed (Bloodhound can see the trend series), but I don't know how to access them from ninjascript. I could use some help there if it is possible.
Here are a couple; one for a neutral and one for a trending. The names are not different, just colors are different. I'm also including a screenshot from what Bloodhound Sees. Thanks for the help.