Пример #1
0
 public virtual FormulaPackage Run(IDataProvider dp)
 {
     this.DataProvider = (__Null)dp;
     return(new FormulaPackage(new FormulaData[1]
     {
         FormulaData.op_Division(FormulaData.op_Subtraction(FormulaBase.HHV(this.get_CLOSE(), this.N), FormulaBase.LLV(this.get_CLOSE(), this.N)), FormulaBase.SUM(FormulaBase.ABS(FormulaData.op_Subtraction(this.get_CLOSE(), FormulaBase.REF(this.get_CLOSE(), 1.0))), this.N))
     }, ""));
 }
Пример #2
0
        public virtual FormulaPackage Run(IDataProvider dp)
        {
            this.DataProvider = (__Null)dp;
            FormulaData formulaData1 = FormulaBase.HHV(this.get_H(), this.N);

            formulaData1.Name = (__Null)"A ";
            FormulaData formulaData2 = FormulaBase.LLV(this.get_L(), this.N);

            formulaData2.Name = (__Null)"B ";
            FormulaData formulaData3 = FormulaData.op_Multiply(FormulaBase.BACKSET(this.get_ISLASTBAR(), this.N), FormulaData.op_Implicit(formulaData1.get_LASTDATA()));

            formulaData3.Name = (__Null)"HH";
            formulaData3.SetAttrs("WIDTH2");
            FormulaData formulaData4 = FormulaData.op_Multiply(FormulaBase.BACKSET(this.get_ISLASTBAR(), this.N), FormulaData.op_Implicit(formulaData2.get_LASTDATA()));

            formulaData4.Name = (__Null)"LL";
            formulaData4.SetAttrs("WIDTH2");
            FormulaData formulaData5 = FormulaData.op_Subtraction(formulaData3, formulaData4);

            formulaData5.Name = (__Null)"HEIGHT ";
            FormulaData formulaData6 = FormulaData.op_Addition(formulaData4, FormulaData.op_Multiply(formulaData5, FormulaData.op_Implicit(0.382)));

            formulaData6.Name = (__Null)"A1 ";
            FormulaData formulaData7 = FormulaData.op_Addition(formulaData4, FormulaData.op_Multiply(formulaData5, FormulaData.op_Implicit(0.5)));

            formulaData7.Name = (__Null)"A2 ";
            FormulaData formulaData8 = FormulaData.op_Addition(formulaData4, FormulaData.op_Multiply(formulaData5, FormulaData.op_Implicit(0.618)));

            formulaData8.Name = (__Null)"A3 ";
            this.SETTEXTVISIBLE(formulaData3, false);
            this.SETTEXTVISIBLE(formulaData4, false);
            this.SETTEXTVISIBLE(formulaData6, false);
            this.SETTEXTVISIBLE(formulaData7, false);
            this.SETTEXTVISIBLE(formulaData8, false);
            return(new FormulaPackage(new FormulaData[5]
            {
                formulaData3,
                formulaData4,
                formulaData6,
                formulaData7,
                formulaData8
            }, ""));
        }
Пример #3
0
        public virtual FormulaPackage Run(IDataProvider dp)
        {
            this.DataProvider = (__Null)dp;
            FormulaData formulaData1 = FormulaData.op_Division(FormulaData.op_Addition(FormulaData.op_Addition(this.get_HIGH(), this.get_LOW()), this.get_CLOSE()), FormulaData.op_Implicit(3.0));

            formulaData1.Name = (__Null)"TYP";
            FormulaData formulaData2 = FormulaBase.LLV(this.get_LOW(), this.N);

            formulaData2.Name = (__Null)"LL";
            FormulaData formulaData3 = FormulaBase.HHV(this.get_HIGH(), this.N);

            formulaData3.Name = (__Null)"HH";
            FormulaData formulaData4 = FormulaData.op_Addition(formulaData1, FormulaData.op_Subtraction(formulaData1, formulaData2));

            formulaData4.Name = (__Null)"WR";
            FormulaData formulaData5 = FormulaData.op_Addition(formulaData1, FormulaData.op_Subtraction(formulaData3, formulaData2));

            formulaData5.Name = (__Null)"MR";
            FormulaData formulaData6 = FormulaData.op_Subtraction(FormulaData.op_Multiply(FormulaData.op_Implicit(2.0), formulaData3), formulaData2);

            formulaData6.Name = (__Null)"SR";
            FormulaData formulaData7 = FormulaData.op_Subtraction(formulaData1, FormulaData.op_Subtraction(formulaData3, formulaData1));

            formulaData7.Name = (__Null)"WS";
            FormulaData formulaData8 = FormulaData.op_Subtraction(formulaData1, FormulaData.op_Subtraction(formulaData3, formulaData2));

            formulaData8.Name = (__Null)"MS";
            FormulaData formulaData9 = FormulaData.op_Subtraction(FormulaData.op_Multiply(FormulaData.op_Implicit(2.0), formulaData2), formulaData3);

            formulaData9.Name = (__Null)"SS";
            return(new FormulaPackage(new FormulaData[6]
            {
                formulaData4,
                formulaData5,
                formulaData6,
                formulaData7,
                formulaData8,
                formulaData9
            }, ""));
        }
Пример #4
0
        public override FormulaPackage Run(IDataProvider dp)
        {
            this.DataProvider = dp;
            FormulaData formulaData = (base.C - FormulaBase.LLV(base.L, this.N)) / (FormulaBase.HHV(base.H, this.N) - FormulaBase.LLV(base.L, this.N)) * 100.0;

            formulaData.Name = "A";
            FormulaData formulaData2 = FormulaBase.MA(formulaData, this.M1);

            formulaData2.Name = "K";
            formulaData2.SetAttrs("COLORDARKGREEN,WIDTH2,HIGHQUALITY");
            FormulaData formulaData3 = FormulaBase.MA(formulaData2, this.M2);

            formulaData3.Name = "D";
            FormulaData formulaData4 = base.PARTLINE(formulaData2 >= formulaData3, formulaData2);

            formulaData4.SetAttrs("COLORRED,WIDTH2,HIGHQUALITY");
            return(new FormulaPackage(new FormulaData[]
            {
                formulaData2,
                formulaData3,
                formulaData4
            }, ""));
        }
Пример #5
0
 public virtual FormulaPackage Run(IDataProvider dp)
 {
     this.DataProvider = (__Null)dp;
     return(new FormulaPackage(new FormulaData[1]
     {
         FormulaData.op_Division(FormulaData.op_Multiply(FormulaData.op_Implicit(100.0), FormulaData.op_Subtraction(FormulaBase.HHV(this.get_HIGH(), this.N), this.get_CLOSE())), FormulaData.op_Subtraction(FormulaBase.HHV(this.get_HIGH(), this.N), FormulaBase.LLV(this.get_LOW(), this.N)))
     }, ""));
 }
Пример #6
0
        public virtual FormulaPackage Run(IDataProvider dp)
        {
            this.DataProvider = (__Null)dp;
            FormulaData formulaData1 = FormulaData.op_Multiply(FormulaData.op_Division(FormulaData.op_Subtraction(this.get_C(), FormulaBase.LLV(this.get_L(), this.N)), FormulaData.op_Subtraction(FormulaBase.HHV(this.get_H(), this.N), FormulaBase.LLV(this.get_L(), this.N))), FormulaData.op_Implicit(100.0));

            formulaData1.Name = (__Null)"A";
            FormulaData formulaData2 = FormulaBase.MA(formulaData1, this.M1);

            formulaData2.Name = (__Null)"K";
            formulaData2.SetAttrs("COLORDARKGREEN,WIDTH2,HIGHQUALITY");
            FormulaData formulaData3 = FormulaBase.MA(formulaData2, this.M2);

            formulaData3.Name = (__Null)"D";
            FormulaData formulaData4 = this.PARTLINE(FormulaData.op_GreaterThanOrEqual(formulaData2, formulaData3), formulaData2);

            formulaData4.SetAttrs("COLORRED,WIDTH2,HIGHQUALITY");
            return(new FormulaPackage(new FormulaData[3]
            {
                formulaData2,
                formulaData3,
                formulaData4
            }, ""));
        }
Пример #7
0
        public virtual FormulaPackage Run(IDataProvider dp)
        {
            this.DataProvider = (__Null)dp;
            FormulaData formulaData1 = FormulaData.op_Multiply(FormulaData.op_Division(FormulaData.op_Subtraction(this.get_CLOSE(), FormulaBase.LLV(this.get_LOW(), this.N)), FormulaData.op_Subtraction(FormulaBase.HHV(this.get_HIGH(), this.N), FormulaBase.LLV(this.get_LOW(), this.N))), FormulaData.op_Implicit(100.0));

            formulaData1.Name = (__Null)"A";
            FormulaData formulaData2 = FormulaBase.MA(formulaData1, this.M1);

            formulaData2.Name = (__Null)"K";
            FormulaData formulaData3 = FormulaBase.MA(formulaData2, this.M2);

            formulaData3.Name = (__Null)"D";
            return(new FormulaPackage(new FormulaData[2]
            {
                formulaData2,
                formulaData3
            }, ""));
        }
Пример #8
0
        public override FormulaPackage Run(IDataProvider dp)
        {
            this.DataProvider = dp;
            FormulaData formulaData = (base.CLOSE - FormulaBase.LLV(base.LOW, this.N)) / (FormulaBase.HHV(base.HIGH, this.N) - FormulaBase.LLV(base.LOW, this.N)) * 100.0;

            formulaData.Name = "A";
            FormulaData majorLine = FormulaBase.MA(formulaData, this.M1);

            majorLine.Name = "K";
            FormulaData majorLineMA = FormulaBase.MA(majorLine, this.M2);

            majorLineMA.Name = "D";

            FormulaData overboughtThreshold = 80.0;
            FormulaData oversoldThreshold   = 20.0;

            FormulaData overboughtZone = base.FILLRGN(majorLine > overboughtThreshold, majorLine, overboughtThreshold);

            overboughtZone.SetAttrs("BRUSH#ABCE2A60"); //alpha = 00 means absolute transparent FF means solid
            FormulaData oversoldZone = base.FILLRGN(majorLine < oversoldThreshold, majorLine, oversoldThreshold);

            oversoldZone.SetAttrs("BRUSH#AB6BCE2A");

            return(new FormulaPackage(new FormulaData[]
            {
                majorLine,
                majorLineMA,
                overboughtThreshold,
                oversoldThreshold,
                overboughtZone,
                oversoldZone,
            }, ""));
        }
Пример #9
0
        public virtual FormulaPackage Run(IDataProvider dp)
        {
            this.DataProvider = (__Null)dp;
            FormulaData formulaData1 = FormulaBase.REF(this.get_CLOSE(), 1.0);

            formulaData1.Name = (__Null)"LC ";
            FormulaData formulaData2 = FormulaData.op_Multiply(FormulaData.op_Division(FormulaBase.SMA(FormulaBase.MAX(new FormulaData[2]
            {
                FormulaData.op_Subtraction(this.get_CLOSE(), formulaData1),
                FormulaData.op_Implicit(0.0)
            }), this.N, 1.0), FormulaBase.SMA(FormulaBase.ABS(FormulaData.op_Subtraction(this.get_CLOSE(), formulaData1)), this.N, 1.0)), FormulaData.op_Implicit(100.0));

            formulaData2.Name = (__Null)"RSI";
            return(new FormulaPackage(new FormulaData[1]
            {
                FormulaData.op_Division(FormulaData.op_Subtraction(formulaData2, FormulaBase.LLV(formulaData2, this.N)), FormulaData.op_Subtraction(FormulaBase.HHV(formulaData2, this.N), FormulaBase.LLV(formulaData2, this.N)))
            }, ""));
        }