7-13 日K蜡烛图(15 分)

7-13 日K蜡烛图(15 分)
股票价格涨跌趋势,常用蜡烛图技术中的K线图来表示,分为按日的日K线、按周的周K线、按月的月K线等。以日K线为例,每天股票价格从开盘到收盘走完一天,对应一根蜡烛小图,要表示四个价格:开盘价格Open(早上刚刚开始开盘买卖成交的第1笔价格)、收盘价格Close(下午收盘时最后一笔成交的价格)、中间的最高价High和最低价Low。

如果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");
            }
        }

    }
}
阅读更多
想对作者说点什么?
相关热词

博主推荐

换一批

没有更多推荐了,返回首页