Exemplo n.º 1
0
 public static bool SendNotification(this MqlHandler handler, string notification)
 {
     return(Convertor.ToBoolean(handler.CallMqlMethod("SendNotification", new object[1]
     {
         (object)notification
     })));
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Calculates the Parabolic Stop and Reverse system and returns its value.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="timeframe"></param>
        /// <param name="step"></param>
        /// <param name="maximum"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static double iSAR(this MqlHandler handler, string symbol, TIME_FRAME timeframe, double step,
                                  double maximum, int shift)
        {
            string retrunValue = handler.CallMqlMethod("iSAR", symbol, ((int)timeframe), step, maximum, shift);

            return(Convertor.ToDouble(retrunValue));
        }
Exemplo n.º 3
0
 private HandlerProvider(MqlHandler mqlHandler, HandlerElement handlerElement, ExpertInfo expertInfo)
 {
     this._mqlHandler = mqlHandler;
     this._mqlHandler.CallMqlInternal = new Func <string, IEnumerable <string>, string>(this.OnCallMqlMethod);
     this.HandlerConfiguration        = handlerElement;
     this.ExpertInfo = expertInfo;
 }
Exemplo n.º 4
0
 private HandlerProvider(MqlHandler mqlHandler, HandlerElement handlerElement, ExpertInfo expertInfo)
 {
     _mqlHandler = mqlHandler;
     _mqlHandler.CallMqlInternal = OnCallMqlMethod;
     HandlerConfiguration        = handlerElement;
     ExpertInfo = expertInfo;
 }
Exemplo n.º 5
0
        /// <summary>
        ///     Returns free margin that remains after the specified position has been opened at the current price on the current account. If the free margin is insufficient, an error 134 (ERR_NOT_ENOUGH_MONEY) will be generated.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="cmd"></param>
        /// <param name="volume"></param>
        /// <returns></returns>
        public static double AccountFreeMarginCheck(this MqlHandler handler, string symbol, ORDER_TYPE cmd,
                                                    double volume)
        {
            string retrunValue = handler.CallMqlMethod("AccountFreeMarginCheck", symbol, (int)cmd, volume);

            return(Convertor.ToDouble(retrunValue));
        }
Exemplo n.º 6
0
        /// <summary>
        ///     The function selects an order for further processing. It returns TRUE if the function succeeds. It returns FALSE if the function fails. To get the error information, one has to call the GetLastError() function.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="index">Order index or order ticket depending on the second parameter.</param>
        /// <param name="select">
        ///     Selecting flags. It can be any of the following values:
        ///     SELECT_BY_POS - index in the order pool,
        ///     SELECT_BY_TICKET - index is order ticket.
        /// </param>
        /// <param name="pool">
        ///     Optional order pool index. Used when the selected parameter is SELECT_BY_POS. It can be any of the following values:
        ///     MODE_TRADES (default)- order selected from trading pool(opened and pending orders),
        ///     MODE_HISTORY - order selected from history pool (closed and canceled order).
        /// </param>
        /// <returns></returns>
        public static bool OrderSelect(this MqlHandler handler, int index, SELECT_BY select,
                                       POOL_MODES pool = POOL_MODES.MODE_TRADES)
        {
            string retrunValue = handler.CallMqlMethod("OrderSelect", index, (int)select, (int)pool);

            return(Convertor.ToBoolean(retrunValue));
        }
Exemplo n.º 7
0
 public static void Print(this MqlHandler handler, string message)
 {
     handler.CallMqlMethod("Print", new object[1]
     {
         (object)message
     });
 }
Exemplo n.º 8
0
 public static bool WindowIsVisible(this MqlHandler handler, int index)
 {
     return(Convertor.ToBoolean(handler.CallMqlMethod("WindowIsVisible", new object[1]
     {
         (object)index
     })));
 }
Exemplo n.º 9
0
        /// <summary>
        ///     Calculates the DeMarker indicator and returns its value.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="timeframe"></param>
        /// <param name="period"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static double iDeMarker(this MqlHandler handler, string symbol, TIME_FRAME timeframe, int period,
                                       int shift)
        {
            string retrunValue = handler.CallMqlMethod("iDeMarker", symbol, ((int)timeframe), period, shift);

            return(Convertor.ToDouble(retrunValue));
        }
Exemplo n.º 10
0
        /// <summary>
        ///     Calculates the Fractals and returns its value.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="timeframe"></param>
        /// <param name="mode"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static double iFractals(this MqlHandler handler, string symbol, TIME_FRAME timeframe, BAND_MODE mode,
                                       int shift)
        {
            string retrunValue = handler.CallMqlMethod("iFractals", symbol, ((int)timeframe), ((int)mode), shift);

            return(Convertor.ToDouble(retrunValue));
        }
Exemplo n.º 11
0
 public static DateTime Time(this MqlHandler handler, int i)
 {
     return(Convertor.ToDateTime(handler.CallMqlMethod("Time", new object[1]
     {
         (object)i
     })));
 }
Exemplo n.º 12
0
        /// <summary>
        ///     Closes opened order. If the function succeeds, the return value is true. If the function fails, the return value is false. To get the detailed error information, call GetLastError().
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="ticket">Unique number of the order ticket.</param>
        /// <param name="lots">Number of lots.</param>
        /// <param name="price">Preferred closing price.</param>
        /// <param name="slippage">Value of the maximum price slippage in points.</param>
        /// <param name="color">Color of the closing arrow on the chart. If the parameter is missing or has CLR_NONE value closing arrow will not be drawn on the chart.</param>
        /// <returns></returns>
        public static bool OrderClose(this MqlHandler handler, int ticket, double lots, double price, int slippage,
                                      int color = 0)
        {
            string retrunValue = handler.CallMqlMethod("OrderClose", ticket, lots, price, slippage, color);

            return(Convertor.ToBoolean(retrunValue));
        }
Exemplo n.º 13
0
 public static void PlaySound(this MqlHandler handler, string filename)
 {
     handler.CallMqlMethod("PlaySound", new object[1]
     {
         (object)filename
     });
 }
Exemplo n.º 14
0
 public static void HideTestIndicators(this MqlHandler handler, bool hide)
 {
     handler.CallMqlMethod("HideTestIndicators", new object[1]
     {
         (object)(hide ? 1 : 0)
     });
 }
Exemplo n.º 15
0
 public static int WindowFind(this MqlHandler handler, string name)
 {
     return(Convertor.ToInt(handler.CallMqlMethod("WindowFind", new object[1]
     {
         (object)name
     })));
 }
Exemplo n.º 16
0
 public static void RunTests(MqlHandler script)
 {
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iAC: " + script.iAC(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iAD: " + script.iAD(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iAlligator: " + script.iAlligator(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 5, 5, 5, 5, 5, 5, MA_METHOD.MODE_EMA, APPLY_PRICE.PRICE_CLOSE, GATOR_MODE.MODE_GATORJAW, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iADX: " + script.iADX(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 9, APPLY_PRICE.PRICE_CLOSE, ADX_MODE.MODE_MAIN, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iATR: " + script.iATR(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 12, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iAO: " + script.iAO(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iBearsPower: " + script.iBearsPower(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 25, APPLY_PRICE.PRICE_CLOSE, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iBands: " + script.iBands(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 24, 2, 2, APPLY_PRICE.PRICE_CLOSE, BAND_MODE.MODE_LOWER, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iBullsPower: " + script.iBullsPower(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 23, APPLY_PRICE.PRICE_CLOSE, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iCCI: " + script.iCCI(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 24, APPLY_PRICE.PRICE_CLOSE, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iDeMarker: " + script.iDeMarker(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 24, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iEnvelopes: " + script.iEnvelopes(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 24, MA_METHOD.MODE_EMA, 0, APPLY_PRICE.PRICE_CLOSE, 2, BAND_MODE.MODE_LOWER, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iForce: " + script.iForce(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 25, MA_METHOD.MODE_EMA, APPLY_PRICE.PRICE_CLOSE, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iFractals: " + script.iFractals(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, BAND_MODE.MODE_LOWER, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iGator: " + script.iGator(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 24, 0, 23, 0, 21, 0, MA_METHOD.MODE_EMA, APPLY_PRICE.PRICE_CLOSE, BAND_MODE.MODE_LOWER, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iIchimoku: " + script.iIchimoku(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 4, 2, 6, ICHIMOKU_MODE.MODE_CHINKOUSPAN, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iBWMFI: " + script.iBWMFI(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iMomentum: " + script.iMomentum(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 24, APPLY_PRICE.PRICE_CLOSE, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iMFI: " + script.iMFI(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 24, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iMA: " + script.iMA(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 25, 0, MA_METHOD.MODE_EMA, APPLY_PRICE.PRICE_CLOSE, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iOsMA: " + script.iOsMA(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 22, 43, 23, APPLY_PRICE.PRICE_CLOSE, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iMACD: " + script.iMACD(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 23, 23, 23, APPLY_PRICE.PRICE_CLOSE, MACD_MODE.MODE_MAIN, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iOBV: " + script.iOBV(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, APPLY_PRICE.PRICE_CLOSE, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iSAR: " + script.iSAR(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 2, 3, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iRSI: " + script.iRSI(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 24, APPLY_PRICE.PRICE_CLOSE, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iRVI: " + script.iRVI(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 25, MACD_MODE.MODE_MAIN, 0)));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iStdDev: " + script.iStdDev(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 23, 0, MA_METHOD.MODE_EMA, APPLY_PRICE.PRICE_CLOSE, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iStochastic: " + script.iStochastic(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 23, 12, 2, MA_METHOD.MODE_EMA, APPLY_PRICE.PRICE_CLOSE, MACD_MODE.MODE_MAIN, 0) + "'"));
     Trace.Write(new LogInfo(LogType.Notifications, message: "Test 'iWPR: " + script.iWPR(SYMBOLS.EURUSD, TIME_FRAME.PERIOD_H1, 23, 0) + "'"));
 }
Exemplo n.º 17
0
        public static void RunTests(MqlHandler script)
        {
            int ticket = script.OrderSend(SYMBOLS.EURUSD, ORDER_TYPE.OP_BUY, 0.1, script.Ask(), 3, 0, 0);

            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderSend: " + ticket + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderSelect: " + script.OrderSelect(ticket, SELECT_BY.SELECT_BY_TICKET) + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderModify: " + script.OrderModify(ticket, script.OrderOpenPrice(), 0.1112, 2.3645) + "'"));

            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderClosePrice: " + script.OrderClosePrice() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderCloseTime: " + script.OrderCloseTime() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderComment: " + script.OrderComment() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderCommission: " + script.OrderCommission() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderExpiration: " + script.OrderExpiration() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderLots: " + script.OrderLots() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderMagicNumber: " + script.OrderMagicNumber() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderOpenPrice: " + script.OrderOpenPrice() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderOpenTime: " + script.OrderOpenTime() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderProfit: " + script.OrderProfit() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderStopLoss: " + script.OrderStopLoss() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderSwap: " + script.OrderSwap() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderSymbol: " + script.OrderSymbol() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderTakeProfit: " + script.OrderTakeProfit() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderTicket: " + script.OrderTicket() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderType: " + script.OrderType() + "'"));

            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrdersTotal: " + script.OrdersTotal() + "'"));
            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'HistoryTotal: " + script.HistoryTotal() + "'"));

            Trace.Write(new TraceInfo(BridgeTraceErrorType.Debug, message: "Test 'OrderClose: " + script.OrderClose(ticket, 0.1, script.Bid(), 3) + "'"));

            // UNCOVERED BY TESTS : OrderPrint(), OrderCloseBy(...), OrderDelete(...) and Pending orders approach
        }
Exemplo n.º 18
0
 public static double Open(this MqlHandler handler, int i)
 {
     return(Convertor.ToDouble(handler.CallMqlMethod("Open", new object[1]
     {
         (object)i
     })));
 }
Exemplo n.º 19
0
 private HandlerProvider(MqlHandler mqlHandler, HandlerElement handlerElement, ExpertInfo expertInfo)
 {
     _mqlHandler = mqlHandler;
     _mqlHandler.CallMqlInternal = OnCallMqlMethod;
     HandlerConfiguration = handlerElement;
     ExpertInfo = expertInfo;
 }
Exemplo n.º 20
0
        /// <summary>
        ///     Calculates the Bears Power indicator and returns its value.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="timeframe"></param>
        /// <param name="period"></param>
        /// <param name="appliedApplyPrice"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static double iBearsPower(this MqlHandler handler, string symbol, TIME_FRAME timeframe, int period,
                                         APPLY_PRICE appliedApplyPrice, int shift)
        {
            string retrunValue = handler.CallMqlMethod("iBearsPower", symbol, ((int)timeframe), period, shift);

            return(Convertor.ToDouble(retrunValue));
        }
Exemplo n.º 21
0
        /// <summary>
        ///     Calculates the Relative Vigor index and returns its value.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="timeframe"></param>
        /// <param name="period"></param>
        /// <param name="mode"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static double iRVI(this MqlHandler handler, string symbol, TIME_FRAME timeframe, int period,
                                  MACD_MODE mode, int shift)
        {
            string retrunValue = handler.CallMqlMethod("iRVI", symbol, ((int)timeframe), period, ((int)mode), shift);

            return(Convertor.ToDouble(retrunValue));
        }
Exemplo n.º 22
0
 public static double WindowPriceMin(this MqlHandler handler, int index = 0)
 {
     return(Convertor.ToDouble(handler.CallMqlMethod("WindowPriceMin", new object[1]
     {
         (object)index
     })));
 }
Exemplo n.º 23
0
        /// <summary>
        ///     Saves current chart screen shot as a GIF file. Returns FALSE if it fails.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="filename"></param>
        /// <param name="size_x"></param>
        /// <param name="size_y"></param>
        /// <param name="start_bar"></param>
        /// <param name="chart_scale"></param>
        /// <param name="chart_mode"></param>
        /// <returns></returns>
        public static bool WindowScreenShot(this MqlHandler handler, string filename, int size_x, int size_y,
                                            int start_bar = -1, int chart_scale = -1, int chart_mode = -1)
        {
            string retrunValue = handler.CallMqlMethod("WindowScreenShot", filename, size_x, size_y, start_bar,
                                                       chart_scale, chart_mode);

            return(Convertor.ToBoolean(retrunValue));
        }
Exemplo n.º 24
0
        public bool ModifyOffer(MqlHandler handler, int ticketNumber, double price, double stopLoss, double takeProfit)
        {
            var result = _tradingFunctionsWrapper.OrderModify(handler, ticketNumber, price, stopLoss, takeProfit);

            _log.DebugFormat("ModifyOrder. Handler Name={0}, TicketNumber={1}, Price={2}, StopLoss={3}, TakeProfit={4}", handler.GetType().Name, ticketNumber, price, stopLoss, takeProfit);
            _log.DebugFormat("ModifyOrder. Result={0}", result);
            return(result);
        }
Exemplo n.º 25
0
        public int OpenOffer(MqlHandler handler, string symbol, ORDER_TYPE orderType, double orderAmount, double price, int slippage, double stopLoss, double takeProfit)
        {
            var result = _tradingFunctionsWrapper.OrderSend(handler, symbol, orderType, orderAmount, price, slippage, stopLoss, takeProfit);

            _log.DebugFormat("Send offer. Symbol={0}, OrderType={1}, OrderAmount={2}, Price={3}, Slippage={4}, StopLoss={5}, TakeProfit={6}", symbol, orderType, orderAmount, price, slippage, stopLoss, takeProfit);
            _log.DebugFormat("Send offer. Result={0}", result);
            return(result);
        }
Exemplo n.º 26
0
        /// <summary>
        ///     Calculates the Moving Average of Oscillator and returns its value. Sometimes called MACD Histogram in some systems.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="timeframe"></param>
        /// <param name="fast_ema_period"></param>
        /// <param name="slow_ema_period"></param>
        /// <param name="signal_period"></param>
        /// <param name="appliedApplyPrice"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static double iOsMA(this MqlHandler handler, string symbol, TIME_FRAME timeframe, int fast_ema_period,
                                   int slow_ema_period, int signal_period, APPLY_PRICE appliedApplyPrice, int shift)
        {
            string retrunValue = handler.CallMqlMethod("iOsMA", symbol, ((int)timeframe), fast_ema_period,
                                                       slow_ema_period, signal_period, ((int)appliedApplyPrice), shift);

            return(Convertor.ToDouble(retrunValue));
        }
Exemplo n.º 27
0
        /// <summary>
        ///     Calculates the Ichimoku Kinko Hyo and returns its value.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="timeframe"></param>
        /// <param name="tenkan_sen"></param>
        /// <param name="kijun_sen"></param>
        /// <param name="senkou_span_b"></param>
        /// <param name="mode"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static double iIchimoku(this MqlHandler handler, string symbol, TIME_FRAME timeframe, int tenkan_sen,
                                       int kijun_sen, int senkou_span_b, ICHIMOKU_MODE mode, int shift)
        {
            string retrunValue = handler.CallMqlMethod("iIchimoku", symbol, ((int)timeframe), tenkan_sen, kijun_sen,
                                                       senkou_span_b, ((int)mode), shift);

            return(Convertor.ToDouble(retrunValue));
        }
Exemplo n.º 28
0
        /// <summary>
        ///     Calculates the Standard Deviation indicator and returns its value.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="timeframe"></param>
        /// <param name="ma_period"></param>
        /// <param name="ma_shift"></param>
        /// <param name="ma_method"></param>
        /// <param name="appliedApplyPrice"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static double iStdDev(this MqlHandler handler, string symbol, TIME_FRAME timeframe, int ma_period,
                                     int ma_shift, MA_METHOD ma_method, APPLY_PRICE appliedApplyPrice, int shift)
        {
            string retrunValue = handler.CallMqlMethod("iStdDev", symbol, ((int)timeframe), ma_period, ma_shift,
                                                       ((int)ma_method), ((int)appliedApplyPrice), shift);

            return(Convertor.ToDouble(retrunValue));
        }
Exemplo n.º 29
0
        /// <summary>
        ///     Modification of characteristics for the previously opened position or pending orders. If the function succeeds, the returned value will be TRUE. If the function fails, the returned value will be FALSE. To get the detailed error information, call GetLastError() function.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="ticket">Unique number of the order ticket.</param>
        /// <param name="price">New open price of the pending order.</param>
        /// <param name="stoploss">New StopLoss level.</param>
        /// <param name="takeprofit">New TakeProfit level.</param>
        /// <param name="expiration">Pending order expiration time.</param>
        /// <param name="arrow_color">Arrow color for StopLoss/TakeProfit modifications in the chart. If the parameter is missing or has CLR_NONE value, the arrows will not be shown in the chart.</param>
        /// <returns></returns>
        public static bool OrderModify(this MqlHandler handler, int ticket, double price, double stoploss,
                                       double takeprofit, DateTime expiration = default(DateTime), int arrow_color = 0)
        {
            string retrunValue = handler.CallMqlMethod("OrderModify", ticket, price, stoploss, takeprofit, expiration,
                                                       arrow_color);

            return(Convertor.ToBoolean(retrunValue));
        }
Exemplo n.º 30
0
        /// <summary>
        ///     Calculates the Bollinger bands® indicator and returns its value.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="timeframe"></param>
        /// <param name="period"></param>
        /// <param name="deviation"></param>
        /// <param name="bands_shift"></param>
        /// <param name="appliedApplyPrice"></param>
        /// <param name="mode"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static double iBands(this MqlHandler handler, string symbol, TIME_FRAME timeframe, int period,
                                    int deviation, int bands_shift, APPLY_PRICE appliedApplyPrice, BAND_MODE mode,
                                    int shift)
        {
            string retrunValue = handler.CallMqlMethod("iBands", symbol, ((int)timeframe), period, deviation,
                                                       bands_shift, ((int)appliedApplyPrice), ((int)mode), shift);

            return(Convertor.ToDouble(retrunValue));
        }
Exemplo n.º 31
0
        /// <summary>
        ///     Calculates the Stochastic oscillator and returns its value.
        /// </summary>
        /// <param name="handler"></param>
        /// <param name="symbol"></param>
        /// <param name="timeframe"></param>
        /// <param name="Kperiod"></param>
        /// <param name="Dperiod"></param>
        /// <param name="slowing"></param>
        /// <param name="method"></param>
        /// <param name="applyPriceField"></param>
        /// <param name="mode"></param>
        /// <param name="shift"></param>
        /// <returns></returns>
        public static double iStochastic(this MqlHandler handler, string symbol, TIME_FRAME timeframe, int Kperiod,
                                         int Dperiod, int slowing, MA_METHOD method, APPLY_PRICE applyPriceField,
                                         MACD_MODE mode, int shift)
        {
            string retrunValue = handler.CallMqlMethod("iStochastic", symbol, ((int)timeframe), Kperiod, Dperiod,
                                                       slowing, ((int)method), applyPriceField, ((int)mode), shift);

            return(Convertor.ToDouble(retrunValue));
        }