My goal is to make a figure like this picture in a financial indicator,
I want to plot “a colored” financial indicator below a trading chart.
I prepared financial data and data of my indicator:
spy = FinancialData["SPY", "OHLCV", {{2020, 12, 1}, {2020, 12, 10}}];
indicatorData = {{{2020,12,1},1}, {{2020,12,2},2}, {{2020,12,3},3},
{{2020,12,4},-1}, {{2020,12,7},-2}, {{2020,12,8},-3}, {{2020,12,9},1},
{{2020, 12, 10}, 3}};
myIndicator =
FinancialIndicator[TimeSeries[indicatorData] &, "LineStyle" -> Blue,
"IndexLine" -> 0];
The plot of the data is
TradingChart[spy, {myIndicator}]
I want to use Hue
and Filling
to fill the indicator with color, depending on "colorData" which is a set of dates and Hue
values,
colorData = {{{2020,12,1}, [email protected]}, {{2020,12,2}, [email protected]},
{{2020,12,3}, Hue@0}, {{2020,12,4}, [email protected]}, {{2020,12,7}, [email protected]},
{{2020,12,8}, [email protected]}, {{2020,12, 9},Hue@0}, {{2020,12,10}, Hue@0}};
I need to fill the region between my indicator and x-axis by using Filling
.
Although I guess Hue
and Filling
are keys to my question, any idea would be appreciated.