Many people do not like to have the chart flooded with lines, drawings, indicators.
They prefer to see the price without much confusion.
Let’s take a simple example of a moving average from this link and see how to transform a moving average into a histogram.
First of all, we modify the Tradestation code in this way:
Input: MA_length(20), MA_histo(1);
vars: MA(0), color(white);
If MA>MA and MA>MA then
color = Green;
If MA<MA and MA<MA then
color = Red;
Plot1( MA_histo, “MA”,color,0,3 );
The algorithm continues to calculate the moving average, but the command Plot1 instead of drawing the line with the value of the average price will draw the fixed amount “1”.
This happens because with this indicator we are interested only in seeing the color that changes when the average is descending or ascending (red and green).
Some indicator settings must also be changed in Tradestation:
This will be the final result:
A very clean graph and the possibility of inserting infinite histogram indicators and even entry or exit signals.