7-13 K candlestick chart (15 points)

7-13 K candlestick chart (15 points)
stock price rising and falling trend, which is usually represented by the candlestick chart technique, which is divided into daily candlestick chart by day, weekly candlestick chart by week, and monthly candlestick chart by month. line etc. Taking the daily K-line as an example, the stock price goes from opening to closing every day, corresponding to a small candle, and four prices should be represented: the opening price Open (the first price of the opening trading transaction just started in the morning), the closing price Close (the price of the last transaction at the close in the afternoon), the highest price in the middle High and the lowest price Low.

If Close

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        double Open,High,Low,Close;
        Open=sc.nextDouble();
        High=sc.nextDouble();
        Low=sc.nextDouble();
        Close=sc.nextDouble();
        if(Close<Open){
            if ((Close<Open) &&((Low<Open)&&(Low<Close) &&(High>Open&&High>Close))){
                System.out.print("BW-Solid with Lower Shadow and Upper Shadow");
            }
            else if((Close<Open)&&((Low<Open)&&(Low<Close))){
                System.out.print("BW-Solid with Lower Shadow");
            }else if((Close<Open)&&(High>Open&&High>Close)){
                System.out.print("BW-Solid with Upper Shadow");
            }else if((Close<Open)){
                System.out.print("BW-Solid");
            }

        }else if(Close>Open){
            if((Close>Open) &&((Low<Open)&&(Low<Close) &&(High>Open&&High>Close))){
                System.out.print("R-Hollow with Lower Shadow and Upper Shadow");
            }else if((Close>Open)&&((Low<Open)&&(Low<Close))){
                System.out.print("R-Hollow with Lower Shadow");
        }else if((Close>Open)&&((High>Open&&High>Close))){
                System.out.print("R-Hollow with Upper Shadow");
            }else{
                System.out.print("R-Hollow");
            }
        }

        else{
            if(((Low<Open)&&(Low<Close) &&(High>Open&&High>Close))){
                System.out.print("R-Cross with Lower Shadow and Upper Shadow");
            }else if(((Low<Open)&&(Low<Close))){
                System.out.print("R-Cross with Lower Shadow");
            }else if((High>Open&&High>Close)){
                System.out.print("R-Cross with Upper Shadow");
            }else{
                System.out.print("R-Cross");
            }
        }

    }
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324504313&siteId=291194637