コード例 #1
0
ファイル: CSVOrder.cs プロジェクト: jseparovic/MQL4CSharp
        public CSVOrder(string pair, string setup, string timeframe, double entry, double stop, double takeProfit1, double takeProfit2)
        {
            this.pair = pair;
            this.setup = setup;
            this.timeframe = timeframe;
            this.entry = entry;
            this.stop = stop;
            this.takeProfit1 = takeProfit1;
            this.takeProfit2 = takeProfit2;

            if (setup.ToLower().Contains("bullish"))
            {
                tradeOperation = TRADE_OPERATION.OP_BUYLIMIT;
                stopDistance = Convert.ToDouble(Convert.ToDecimal(entry) - Convert.ToDecimal(stop));
            }
            else if (setup.ToLower().Contains("bearish"))
            {
                tradeOperation = TRADE_OPERATION.OP_SELLLIMIT;
                stopDistance = Convert.ToDouble(Convert.ToDecimal(stop) - Convert.ToDecimal(entry));
            }
            else
            {
                throw new Exception("Could not parse setup: " + setup);
            }
        }
コード例 #2
0
        public CSVOrder(string pair, string setup, string timeframe, double entry, double stop, double takeProfit1, double takeProfit2)
        {
            this.pair        = pair;
            this.setup       = setup;
            this.timeframe   = timeframe;
            this.entry       = entry;
            this.stop        = stop;
            this.takeProfit1 = takeProfit1;
            this.takeProfit2 = takeProfit2;

            if (setup.ToLower().Contains("bullish"))
            {
                tradeOperation = TRADE_OPERATION.OP_BUYLIMIT;
                stopDistance   = Convert.ToDouble(Convert.ToDecimal(entry) - Convert.ToDecimal(stop));
            }
            else if (setup.ToLower().Contains("bearish"))
            {
                tradeOperation = TRADE_OPERATION.OP_SELLLIMIT;
                stopDistance   = Convert.ToDouble(Convert.ToDecimal(stop) - Convert.ToDecimal(entry));
            }
            else
            {
                throw new Exception("Could not parse setup: " + setup);
            }
        }