オーダーの送信【OrderSend】

int OrderSend(string symbol, int cmd, double volume, double price, intslippage, double stoploss, double takeprofit, string comment=NULL, intmagic=0, datetime expiration=0, color arrow_color=CLR_NONE)

 

The main function used to open a position or place a pending order.

ポジションを開くか、待機注文をするための主たる関数です。

Returns number of the ticket assigned to the order by the trade server or -1 if it fails. To get additional error information, one has to call the GetLastError() function.

トレード サーバーによって定められたチケット番号を返すか、失敗した場合は、-1を返します。詳細なエラー情報を取得するには、GetLastError() 関数を呼び出します。

Notes:

注意:

At opening of a market order (OP_SELL or OP_BUY), only the latest prices of Bid (for selling) or Ask(for buying) can be used as open price. If operation is performed with a security differing from the current one, the MarketInfo() function must be used with MODE_BID or MODE_ASK parameter for the latest quotes for this security to be obtained. Calculated or unnormalized price cannot be applied. If there has not been the requested open price in the price thread or it has not been normalized according to the amount of digits after decimal point, the error 129 (ERR_INVALID_PRICE) will be generated. If the requested open price is fully out of date, the error138 (ERR_REQUOTE) will be generated independently on the slippage parameter. If the requested price is out of date, but present in the thread, the position will be opened at the current price and only if the current price lies within the range of price+-slippage.

市場へ注文(OP_SELL あるいは OP_BUY)を出すときには、注文価格として、Bid(売り)または Ask(買い)の最新価格のみを使用できます。もし、処理を現在の有価証券とは違う状態で行なう場合は、MarketInfo() 関数の MODE_BID もしくは MODE_ASK パラメータを使用して、その有価証券の最新の市場価格を手に入れる必要があります。計算されている、または正規化されていない価格を適用することはできません。もし、要求された注文価格が価格のやり取りになかったり、小数点以下の桁数が正規化されていない場合は、エラー 129 (ERR_INVALID_PRICE) が生成されます。もし、要求された注文価格が完全に期限切れの場合は、エラー 138 (ERR_REQUOTE) が、slippage パラメータに関係なく生成されます。もし、要求された価格が、期限が切れているが、やり取りに存在している場合、そのポジションは、現在価格の price ± slippage の範囲内に現在の価格がある場合に限って、現在価格で約定することができます。

StopLoss and TakeProfit levels cannot be too close to the market. The minimal distance of stop levels in points can be obtained using the MarketInfo() function with MODE_STOPLEVEL parameter. In the case of erroneous or unnormalized stop levels, the error 130 (ERR_INVALID_STOPS) will be generated.

StopLoss と TakeProfit レベルは市場にあまりにも近くにすることはできません。MarketInfo() 関数の MODE_STOPLEVEL パラメータを使用して、ポイントでストップレベルの最小距離を取得できます。誤っているか、あるいは正規化されていないストップレベルの場合は、エラー 130 (ERR_INVALID_STOPS) が生成されます。

At placing of a pending order, the open price cannot be too close to the market. The minimal distance of the pending price from the current market one in points can be obtained using the MarketInfo() function with the MODE_STOPLEVEL parameter. In case of false open price of a pending order, the error 130 (ERR_INVALID_STOPS) will be generated.

保留中の注文をすることにおいて、注文価格は市場にあまりにも近くにすることはできません。MarketInfo()関数の MODE_STOPLEVEL パラメータを使用して、ポイントで現在の市場から保留価格の最小距離を所得できます。待機オーダーの注文価格が適切でない場合は、エラー 130 (ERR_INVALID_STOPS) が生成されます。

Applying of pending order expiration time can be disabled in some trade servers. In this case, when a non-zero value is specified in the expiration parameter, the error 147 (ERR_TRADE_EXPIRATION_DENIED) will be generated.

保留中オーダーの有効期限は、一部のトレード サーバーでは無効にすることができます。この場合、ゼロ以外の値を expiration パラメータに指定すると、エラー 147 (ERR_TRADE_EXPIRATION_DENIED) が生成されます。

On some trade servers, the total amount of open and pending orders can be limited. If this limit has been exceeded, no new position will be opened (or no pending order will be placed) and trade server will return error 148 (ERR_TRADE_TOO_MANY_ORDERS).

一部のトレード サーバー上で、保有中と待機中オーダーの総量は制限することができます。もし、この限界を超えた場合は、新しいポジションは開くこと(もしくは、待機オーダーを出すこと)できず、トレード サーバーから エラー 148 (ERR_TRADE_TOO_MANY_ORDERS) が返されます。

Parameters:

パラメータ:

symbol
Symbol for trading.

取引する通貨ペア。

cmd
Operation type. It can be any of the Trade operation enumeration.

処理の種類。トレード操作列挙体のいずれかを指定できます。

volume
Number of lots.

ロット数。

price
Preferred price of the trade.

取引の提示価格。

slippage
Maximum price slippage for buy or sell orders.

買い、もしくは売りオーダーでの最大スリッページ価格。

stoploss
Stop loss level.

損切りレベル。

takeprofit
Take profit level.

利食いレベル。

comment
Order comment text. Last part of the comment may be changed by server.

オーダーのコメント文。コメントの最後の部分は、サーバーが変更する可能性があります。

magic
Order magic number. May be used as user defined identifier.

オーダーのマジックナンバー。ユーザー定義の識別子とし使用することができます。

expiration
Order expiration time (for pending orders only).

オーダーの有効期限(待機中のオーダーに対してのみ)

arrow_color
Color of the opening arrow on the chart. If parameter is missing or has CLR_NONE value opening arrow is not drawn on the chart.

チャート上の約定した矢印の色。もし、パラメータが欠けているか、CLR_NONE 値をもっている場合は、約定した矢印はチャート上に表示されません。

 

Sample:

サンプル:

 

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">