is it possible to have green colour when the close is greater than open and a red colour when the close is less than the open while using candle

댓글 수: 4

Image Analyst
Image Analyst 2017년 5월 15일
Please attach the image of your candle. I also don't know what "the close is greater than open" or "the close is less than the open" means. What does it mean??? Do you mean close like a verb to shut, as in a door, or close like meaning "nearby"? Actually neither seems to make sense in this context.
dpb
dpb 2017년 5월 15일
'candle' is part of Financial TB so open/close refer to stock ticker prices...it draws what the analysts refer to as a candlstick chart but I admit I know not of which they speak otherwise...
Image Analyst
Image Analyst 2017년 5월 15일
Oh, that's funny. Thanks for clearing it up. I thought it was an actual real candle. Now I understand.
dpb
dpb 2017년 5월 15일
Yeah, I could tell you were thinking "Image processing! My baliwick!", IA... :)
I do enough econometrics stuffs that have run across it; it's similar to box plot idea excepting for stock prices...

댓글을 달려면 로그인하십시오.

답변 (1개)

dpb
dpb 2017년 5월 15일
편집: dpb 2017년 5월 16일

0 개 추천

Well, the doc says "(Optional) Candlestick color is specified as a character vector." which would indicate you can with just a little effort...
clrs=char('r','g'); % the two-vector from which to choose
Color=clrs((ClosePrices>=OpenPrices)+1); % select based on condition
candle(HighPrices,LowPrices,ClosePrices,OpenPrices,Color)
Make tri-state if want "no change" to show up as other than G as will here.
As noted, "air code", can't test as don't have requisite TB.
ADDENDUM
"Tri-state" is just a little different since a single logic comparison is only binary...
clrs=char('r','b','g');
Color=clrs(sign(ClosePrices-OpenPrices)+2);
-1,0,1 --> [1,2,3] ~ 1*sign(deltaPrice) + 2

카테고리

도움말 센터File Exchange에서 Time Series Events에 대해 자세히 알아보기

질문:

2017년 5월 15일

편집:

dpb
2017년 5월 16일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by