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 am trying to download the codes of the VisualEMAX1 and VisualEMAX2 indicators in order me to use them into my strategy.
Alternatively (if not possible the codes) please provide me these indicators in a such a way in order me to be able to use them into my code of my automated strategy (I use NinjaTrader 7).
Those were experimental indicators which are no longer up-to-date. I do not even have them anymore.
VisualEMA:
The main idea of the VisualEMA - hence the name - was to overcome the problem of non-equidistant bar spacing. This is a specific problem of NinjaTrader 7.
Example: You wish to display an EMA(5) calculated from 1 min bars on a renko chart. To do so you would
- add a secondary bar series of 1 min bars to your renko chart
- then set the secondary bars to transparent
- then apply the indicator to the invisible secondary bars
So far so good. The only problem that you will get is the distortion of the primary bars. Your chart will look similar to a battlefield after the fight. The VisualEMA addresses this problem, as it loads the secondary bars and calculates indicator values from those bars. The primary bars are no longer distorted and your chart will look nice and clean as always.
Repainting with default settings
In case you add a secondary bar series to the chart, the two last bars of the secondary bars would typically be at a larger distance than the primary bars. Therefore the VisualEMA will draw the last leg of the indicator plot over a larger distance - for example five primary bars. This means that the VisualEMA is a repainting indicator relative to the primary bars (it would not be repainting relative to the secondary bars). Repainting indicators cannot be easily used for a strategy.
Strategy Mode
Therefore the VisualEMA has a strategy mode (step mode) that allows its use with an automated strategy. You may visualize the strategy mode by adding the VisualEMA to a chart.
You will now see a lagging indicator that paints a steplike pattern on the chart. You may only use the VisualEMA with a strategy, if it is set to strategy mode.
Recommendation
If you add the VisualEMA to a strategy
- the strategy loads the Visual EMA
- the VisualEMA then loads the secondary bars
This is definitely not best practice. I would suggest to let the strategy load the secondary bars, and then apply a standard EMA to the secondary bars. This will lead to the same result as adding the VisualEMA, but it is a much cleaner solution. Furthermore, I would recommend to stop using NinjaTrader 7 and switch to NinjaTrader 8.
Regarding the VisualEMAX1 indicator : What I want to do is to write a simple piece of code with CrossAbove/Below of 2 different VisualEMAX1 indicators (with different parameters each one of them). Please see attaced chart. The problem is that this indicator is appeared ONLY into my chart's indicators list and NOT in my "Edit indicators" list, so I cannot code them in my automated strategy. Is there any way this indicator to be appeared in my "Edit indicator" list ?
Thanks/George
The code comes as an assembly and cannot be edited. As I have explained before, you do not need this indicator for writing a strategy. The strategy may not call it in visual mode. Simply let the strategy add a secondary bar series. Then directly apply the EMA to the secondary bars added. This is a much more reasonable approach and will give you at least similar results. In my opinion it is even an advantage to let the strategy add the secondary bars. Please compare
(1) Using VisualSMA: Strategy adds an indicator to the primary bars. Indicator loads secondary bars to calculate EMA. Result is then returned when the primary bars are called. This approach has two inconvenients
- the bars are loaded by the indicator which is loaded by the strategy
- in case you run it in Calculate.OnBarClose, indicator values calculated from secondary bars are only made available when the primary bar closes (additional lag)
(2) Adding secondary bars via strategy: Indicator is applied to secondary bars and indicator value is returned when the secondary bar closes.
Solution(2) should be preferred over solution(1), because it is a more stable and simpler approach which also does not create an additional lag. Please keep in mind, that the VisualEMA only had the purpose to address the non-equidistant bar spacing.
In case you insist using the VisualEMA, you may create a simple strategy with the strategy builder and unlock it. This will show you how to access the plots.