Beispiel #1
0
        //是否上升
        private void initRize()
        {
            int size = items.Length;

            for (int i = ATTR_CALC_STARTINDEX; i < size - 1; i++)
            {
                StockItem item = items[i];
                double    rize = (item.end - items[i - 1].end) / items[i - 1].end;
                item.attributes[StockAttribute.RIZERATE] = rize;

                item.attributes[StockAttribute.BUYPRICE1] = item.end;
                item.attributes[StockAttribute.BUYPRICE2] = items[i + 1].start;
                item.attributes[StockAttribute.BUYPRICE3] = items[i].end * 0.98;
                item.attributes[StockAttribute.BUYPRICE4] = items[i].end * 0.99;
            }
            items[size - 1].attributes[StockAttribute.RIZERATE]  = (items[size - 1].end - items[size - 2].end) / items[size - 2].end;
            items[size - 1].attributes[StockAttribute.BUYPRICE1] = items[size - 1].end;
            items[size - 1].attributes[StockAttribute.BUYPRICE2] = items[size - 1].end;
            items[size - 1].attributes[StockAttribute.BUYPRICE3] = items[size - 1].end * 0.98;
            items[size - 1].attributes[StockAttribute.BUYPRICE4] = items[size - 1].end * 0.99;
        }
Beispiel #2
0
        //连续6日小阳线
        //且这6日中小阳线产生金叉
        protected override Boolean GetBuy(StockData stock, int index)
        {
            StockItem item  = stock.items[index];
            StockItem yes1  = stock.items[index - 1];
            StockItem yes2  = stock.items[index - 2];
            StockItem yes3  = stock.items[index - 3];
            StockItem yes4  = stock.items[index - 4];
            StockItem yes5  = stock.items[index - 5];
            StockItem yes6  = stock.items[index - 6];
            StockItem yes7  = stock.items[index - 7];
            StockItem yes30 = stock.items[index - 30];

            //if (stock.code == "s002414" && stock.items[index].date == 20180730)
            //{
            //    int abc;
            //    abc = 3;
            //}
            if (Convert.ToDouble(yes1.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes1.attributes[StockAttribute.AVE20]) > StockApp.MIN_ZERO &&
                Convert.ToDouble(yes1.attributes[StockAttribute.AVE20]) - Convert.ToDouble(yes1.attributes[StockAttribute.AVE60]) > StockApp.MIN_ZERO

                && Convert.ToDouble(yes30.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes30.attributes[StockAttribute.AVE20]) < StockApp.MIN_ZERO &&
                Convert.ToDouble(yes30.attributes[StockAttribute.AVE20]) - Convert.ToDouble(yes30.attributes[StockAttribute.AVE60]) < StockApp.MIN_ZERO &&
                Convert.ToDouble(item.end) - Convert.ToDouble(item.attributes[StockAttribute.LOW20]) * 1.23 < StockApp.MIN_ZERO

                && stock.items[index - 1].end - stock.items[index - 4].end <StockApp.MIN_ZERO &&
                                                                            stock.items[index - 2].end - stock.items[index - 4].end <StockApp.MIN_ZERO &&
                                                                                                                                     stock.items[index - 3].end - stock.items[index - 4].end <StockApp.MIN_ZERO &&
                                                                                                                                                                                              stock.items[index].end - stock.items[index - 1].end> StockApp.MIN_ZERO &&
                                                                                                                                     stock.items[index].end - stock.items[index - 2].end> StockApp.MIN_ZERO &&
                                                                            item.end> Convert.ToDouble(item.attributes[StockAttribute.AVE10])
                //&& stock.items[index].end - Convert.ToDouble(stock.items[index].attributes[StockAttribute.AVE10]) > StockApp.MIN_ZERO
                && (item.low * 1.01 < item.end && item.high < item.end * 1.03)
                )
            {
                return(true);
            }

            return(false);
        }
Beispiel #3
0
        protected override Boolean GetBuy(StockData stock, int index)
        {
            StockItem item  = stock.items[index];
            StockItem yes1  = stock.items[index - 1];
            StockItem yes2  = stock.items[index - 2];
            StockItem yes3  = stock.items[index - 3];
            StockItem yes10 = stock.items[index - 10];
            StockItem yes5  = stock.items[index - 5];

            //今天收盘价>昨日20日最高价

            if (item.end > (double)yes1.attributes[StockAttribute.HIGH20] &&
                (double)item.attributes[StockAttribute.AVE20] > (double)item.attributes[StockAttribute.AVE60] &&
                (double)yes10.attributes[StockAttribute.AVE20] < (double)yes10.attributes[StockAttribute.AVE60] &&
                yes5.end < (double)yes5.attributes[StockAttribute.AVE5]
                )
            {
                return(true);
            }

            return(false);
        }
Beispiel #4
0
        protected override Boolean GetBuy(StockData stock, int index)
        {
            int       n     = 0;
            StockItem today = stock.items[index];
            StockItem item  = stock.items[index - n];
            StockItem yes1  = stock.items[index - 1 - n];
            StockItem yes2  = stock.items[index - 2 - n];
            StockItem yes3  = stock.items[index - 3 - n];
            StockItem yes4  = stock.items[index - 4 - n];
            StockItem yes5  = stock.items[index - 5 - n];
            StockItem yes6  = stock.items[index - 6 - n];
            StockItem yes7  = stock.items[index - 7 - n];

            //if (stock.code == "s600277" && stock.items[index].index == 1428)
            //{
            //    int abc;
            //    abc = 3;
            //}
            if (//(item.end >= yes1.end || item.end >= item.start)
                //&& (yes1.end >= yes2.end || yes1.end >= yes1.start)
                //&& (yes2.end >= yes3.end || yes2.end >= yes2.start)
                Convert.ToDouble(item.attributes[StockAttribute.HIGH130]) > 1.75 *  Convert.ToDouble(item.attributes[StockAttribute.LOW130])
                //&& Convert.ToDouble(item.attributes[StockAttribute.HIGH130]) > Convert.ToDouble(item.attributes[StockAttribute.HIGH20])
                && item.end <Convert.ToDouble(item.attributes[StockAttribute.HIGH130]) * 0.75 &&
                             item.end> Convert.ToDouble(item.attributes[StockAttribute.LOW130]) * 1.25

                && Convert.ToDouble(today.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes1.attributes[StockAttribute.AVE5]) > StockApp.MIN_ZERO &&
                Convert.ToDouble(today.attributes[StockAttribute.AVE5]) - Convert.ToDouble(today.attributes[StockAttribute.AVE10]) > StockApp.MIN_ZERO &&
                Convert.ToBoolean(today.kpi[StockKPI.CROSS_AVE_5])

                )
            {
                return(true);
            }

            return(false);
        }
Beispiel #5
0
        //连续6日小阳线
        //且这6日中小阳线产生金叉
        protected override Boolean GetBuy(StockData stock, int index)
        {
            StockItem item  = stock.items[index];
            StockItem yes1  = stock.items[index - 1];
            StockItem yes2  = stock.items[index - 2];
            StockItem yes3  = stock.items[index - 3];
            StockItem yes4  = stock.items[index - 4];
            StockItem yes5  = stock.items[index - 5];
            StockItem yes6  = stock.items[index - 6];
            StockItem yes7  = stock.items[index - 7];
            StockItem yes8  = stock.items[index - 8];
            StockItem yes9  = stock.items[index - 9];
            StockItem yes20 = stock.items[index - 30];

            if (Convert.ToDouble(item.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes1.attributes[StockAttribute.AVE5]) < StockApp.MIN_ZERO &&
                Convert.ToDouble(yes1.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes2.attributes[StockAttribute.AVE5]) < StockApp.MIN_ZERO &&
                item.end >= yes1.end

                && Convert.ToDouble(yes20.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes20.attributes[StockAttribute.AVE10]) * 1.005 < StockApp.MIN_ZERO &&
                Convert.ToDouble(yes20.attributes[StockAttribute.AVE10]) - Convert.ToDouble(yes20.attributes[StockAttribute.AVE20]) * 1.005 < StockApp.MIN_ZERO

                && Convert.ToDouble(yes2.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes3.attributes[StockAttribute.AVE5]) > StockApp.MIN_ZERO &&
                Convert.ToDouble(yes3.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes4.attributes[StockAttribute.AVE5]) > StockApp.MIN_ZERO &&
                Convert.ToDouble(yes4.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes5.attributes[StockAttribute.AVE5]) > StockApp.MIN_ZERO &&
                Convert.ToDouble(yes5.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes6.attributes[StockAttribute.AVE5]) > StockApp.MIN_ZERO &&
                Convert.ToDouble(yes6.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes7.attributes[StockAttribute.AVE5]) > StockApp.MIN_ZERO &&
                Convert.ToDouble(yes7.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes8.attributes[StockAttribute.AVE5]) > StockApp.MIN_ZERO &&
                Convert.ToDouble(yes8.attributes[StockAttribute.AVE5]) - Convert.ToDouble(yes9.attributes[StockAttribute.AVE5]) > StockApp.MIN_ZERO


                )
            {
                return(true);
            }

            return(false);
        }