無料でロボットをダウンロードする方法を見る
Telegram上で私たちを見つけてください。
私たちのファンページに参加してください
私たちのファンページに参加してください
記事を気に入りましたか?MetaTrader 5ターミナルの中でそれを試してみてください。
- ビュー:
- 1556
- 評価:
- パブリッシュ済み:
- 2017.11.14 08:33
- アップデート済み:
- 2018.02.28 16:07
-
このコードに基づいたロボットまたはインジケーターが必要なら、フリーランスでご注文ください フリーランスに移動
The "Pending orders UP" スクリプトは、現在の価格より上に注文のグリッドを設定します。
入力パラメータ
- Gap for pending orders UP from the current price(ピップ単位) - 最初の未決注文を出すための現在の価格からの距離
- Step between orders UP(ピップ単位) - 未決注文間の距離
- Type of pending orders UP - 未決注文の種類(買い指値または売り指値)
- UP quantity - 注文数
- Lots - 各注文の数量
- Stop Loss(ピップ単位) - 決済逆指値
- Take Profit(ピップ単位) - 決済指値
スクリプトは非同期取引モードを使用するため、取引依頼を最短で確実に送ることができます。
m_trade.SetAsyncMode(true);
5つの未決注文に対するリクエストを送信する例を次に示します。
2017.08.28 08:50:22.246 Scripts script Pending orders UP (AUDCAD,Daily) loaded successfully 2017.08.28 08:50:24.095 Trades '6121033': buy stop 0.01 AUDCAD at 0.99262 sl: 0.99011 tp: 0.99462 2017.08.28 08:50:24.095 Trades '6121033': buy stop 0.01 AUDCAD at 0.99412 sl: 0.99161 tp: 0.99612 2017.08.28 08:50:24.095 Trades '6121033': buy stop 0.01 AUDCAD at 0.99562 sl: 0.99311 tp: 0.99762 2017.08.28 08:50:24.096 Trades '6121033': buy stop 0.01 AUDCAD at 0.99712 sl: 0.99461 tp: 0.99912 2017.08.28 08:50:24.096 Trades '6121033': buy stop 0.01 AUDCAD at 0.99862 sl: 0.99611 tp: 1.00062 2017.08.28 08:50:24.097 Scripts script Pending orders UP (AUDCAD,Daily) removed
5つの注文が1ミリ秒で送信されました。
スクリプトの開始から削除までの完全なレポートは次のとおりです(最初の注文時刻は2017.08.28 08:50:24.095でした)。
2017.08.28 08:50:22.246 Scripts script Pending orders UP (AUDCAD,Daily) loaded successfully 2017.08.28 08:50:24.095 Trades '6121033':buy stop 0.01 AUDCAD at 0.99262 sl: 0.99011 tp: 0.99462 2017.08.28 08:50:24.095 Trades '6121033':buy stop 0.01 AUDCAD at 0.99412 sl: 0.99161 tp: 0.99612 2017.08.28 08:50:24.095 Trades '6121033':buy stop 0.01 AUDCAD at 0.99562 sl: 0.99311 tp: 0.99762 2017.08.28 08:50:24.096 Trades '6121033':buy stop 0.01 AUDCAD at 0.99712 sl: 0.99461 tp: 0.99912 2017.08.28 08:50:24.096 Trades '6121033':buy stop 0.01 AUDCAD at 0.99862 sl: 0.99611 tp: 1.00062 2017.08.28 08:50:24.097 Scripts script Pending orders UP (AUDCAD,Daily) removed 2017.08.28 08:50:24.169 Trades '6121033':accepted buy stop 0.01 AUDCAD at 0.99262 sl: 0.99011 tp: 0.99462 2017.08.28 08:50:24.170 Trades '6121033':order #164991202 buy stop 0.01 / 0.01 AUDCAD at market done in 107.907 ms 2017.08.28 08:50:24.170 Trades '6121033':accepted buy stop 0.01 AUDCAD at 0.99412 sl: 0.99161 tp: 0.99612 2017.08.28 08:50:24.174 Trades '6121033':order #164991203 buy stop 0.01 / 0.01 AUDCAD at market done in 78.513 ms 2017.08.28 08:50:24.174 Trades '6121033':accepted buy stop 0.01 AUDCAD at 0.99562 sl: 0.99311 tp: 0.99762 2017.08.28 08:50:24.175 Trades '6121033':order #164991204 buy stop 0.01 / 0.01 AUDCAD at market done in 79.283 ms 2017.08.28 08:50:24.175 Trades '6121033':accepted buy stop 0.01 AUDCAD at 0.99712 sl: 0.99461 tp: 0.99912 2017.08.28 08:50:24.175 Trades '6121033':accepted buy stop 0.01 AUDCAD at 0.99862 sl: 0.99611 tp: 1.00062 2017.08.28 08:50:24.175 Trades '6121033':order #164991205 buy stop 0.01 / 0.01 AUDCAD at market done in 79.516 ms 2017.08.28 08:50:24.175 Trades '6121033':order #164991206 buy stop 0.01 / 0.01 AUDCAD at market done in 79.565 ms
最後の未決注文が確定した時刻は2017.08.28 08:50:24.175です。全ての操作かかったのはわずか計80ミリ秒です。
スクリプト操作の開始時には、指定された未決注文の数量の正当性が確認されます。
//+------------------------------------------------------------------+ //| スクリプトプログラム開始関数 | //+------------------------------------------------------------------+ void OnStart() { //--- if(InpLots<=0.0) { Print("The \"Lots\" can't be smaller or equal to zero"); return; } //--- if(!m_symbol.Name(Symbol())) // 銘柄名を設定する return; if(!RefreshRates()) return; string err_text=""; if(!CheckVolumeValue(InpLots,err_text)) { Print(err_text); return; } //---
MetaQuotes Ltdによってロシア語から翻訳されました。
元のコード: https://www.mql5.com/ru/code/19024

このスクリプトは、複数の未決注文を現在価格よりも低くします。

このエキスパートアドバイザーは線形予測にバーグ法を使用します。