-->
当前位置:首页 > 题库

PROGRAMMING:Day K candle chart

Luz5年前 (2021-05-10)题库458
The rising and falling trend of stock price is usually represented by the K-line chart in candle chart technology, which is divided into daily K-line, weekly K-line and monthly K-line. Take the daily K-line as an example. Every day when the stock price moves from the opening to the closing, it corresponds to a small candle chart, which shows four prices: the opening price is open (the first price in the morning), the closing price is close (the last price in the afternoon), the highest price in the middle is high and the lowest price is low.
If close $$< $$open, it means "BW solid" (i.e. "solid blue and white candle"); If close $$> $$open, it means "r-hollow" (i.e. "hollow red candle"); If open equals close, it is "r-cross". If low is lower than open and close, it is called "lower shadow" (i.e. "with lower shadow") and if high is higher than open and close, it is called "upper shadow" (i.e. "with upper shadow"). Please program, according to the given four price combinations, to determine what kind of candle the day is.
###Input format:
Input four positive real numbers in one line, corresponding to open, high, low and close, separated by spaces.
###Output format:
Output the type of day K candle in one line. If there are upper and lower hatching lines, add 'with hatching type' after the type. If there are both shadow lines, output 'with lower shadow and upper shadow'.
###Input sample 1:
```in
5.110 5.250 5.100 5.105
```
###Output sample 1:
```out
BW-Solid with Lower Shadow and Upper Shadow
```
###Input example 2:
```
5.110 5.110 5.110 5.110
```
###Output example 2:
```
R-Cross
```
###Input sample 3:
```
5.110 5.125 5.112 5.126
```
###Output example 3:
```
R-Hollow
```






answer:If there is no answer, please comment