コーディングのヘルプ - ページ 212 1...205206207208209210211212213214215216217218219...786 新しいコメント Mladen Rakic 2013.12.23 19:35 #2111 zoroxzyad: 私は期間が船体で30にしたい場合、私はチャートで2つのMAまたはhowmuch期間と1つだけ置くべきであるどのようなMVは、私は数学が得意ではありませんとあなたの努力のおかげで非常に非常に多くの男、LWMAを使用しています。 zoroxzyad 移動平均 線だけではダメです。前の投稿にある数式を使用する必要があります。 techmac 2013.12.23 21:25 #2112 新しいメタトレーダー4のマニュアルはまだですか? それともこれから作られるのでしょうか? Mladen Rakic 2013.12.24 07:19 #2113 techmac: 新しいメタトレーダー4のマニュアルはまだですか? それとも作るのでしょうか? 私が知っている限りではありません。あるのでしょうね(開発のどこかの時点で)。 michaelB 2013.12.29 05:27 #2114 Mladenさん、メインチャートにクロスオーバーシグナルを表示するように修正したインジケータを添付します。 このコードは新バージョンのものです。 arrUp[CB] = EMPTY_VALUE; arrDn[CB] = EMPTY_VALUE; state[CB] = state[CB+1]; if (TrendBuffer[CB]>LoBuffer[CB]) state[CB] = 1; if (TrendBuffer[CB]<LoBuffer[CB]) state[CB] = -1; if (state[CB]!=state[CB+1]) { if (state[CB]== 1) arrUp[CB] = Low[CB] -iATR(NULL,0,10,CB)/2.0; if (state[CB]==-1) arrDn[CB] = High[CB]+iATR(NULL,0,10,CB)/2.0; } このコードがどのようにシグナルを挿入するのか、簡単に説明する方法はありますか? ありがとうございます。 ファイル: 5_34_5_on_chart_v02.mq4 4 kb Mladen Rakic 2013.12.29 06:49 #2115 michaelB: Mladenさん、クロスオーバーのシグナルをメインチャートに表示するように改造したインジケータを添付します。このコードは新バージョンのものです。 arrUp[CB] = EMPTY_VALUE; arrDn[CB] = EMPTY_VALUE; state[CB] = state[CB+1]; if (TrendBuffer[CB]>LoBuffer[CB]) state[CB] = 1; if (TrendBuffer[CB]<LoBuffer[CB]) state[CB] = -1; if (state[CB]!=state[CB+1]) { if (state[CB]== 1) arrUp[CB] = Low[CB] -iATR(NULL,0,10,CB)/2.0; if (state[CB]==-1) arrDn[CB] = High[CB]+iATR(NULL,0,10,CB)/2.0; } このコードがどのようにシグナルを挿入するのか、簡単に説明する方法はありますか? ありがとうございます。 マイケル TrendBufferとLoBufferの2つのバッファで、値のクロスを探しているんだ。もしTrendBuffer > LoBufferなら状態を1に、TrendBuffer < LoBufferなら状態を-1にセットするんだ。 ここで、現在のバーの状態が前のバーの状態と異なる場合、それはクロスが発生していることを意味します。そして、チャート上に矢印を描画する。 削除済み 2013.12.29 11:17 #2116 また面倒な先生は、MT4のインジケーターに変換したこのインジケーターを入れてください、ありがとうございました カラーバーズ_hlc.mq5 ファイル: colorbars_hlc.mq5 4 kb michaelB 2013.12.29 15:12 #2117 mladen: マイケル TrendBufferとLoBufferの2つのバッファで、値のクロスを探している。もしTrendBuffer > LoBufferなら状態を1に、TrendBuffer < LoBufferなら状態を-1にセットします。 さて、現在のバーの状態が前のバーの状態と異なっている場合、それはクロスがあることを意味します。そして、チャート上に矢印が描かれます。 さて、これでTrendBufferとLoBufferの説明がつきました。 しかし、arrUpとarrDnはどのように動作するのでしょうか? なぜ、シグナルは 特定のローソク足で表示 され、すべてのローソク足で表示されないのでしょうか。 ありがとうございました。 Mladen Rakic 2013.12.29 15:27 #2118 michaelB: これで、TrendBufferとLoBufferの説明ができました。しかし、arrUpとarrDnはどのように機能するのでしょうか?なぜ、シグナルは特定のローソク足で表示され、すべてのローソク足で表示されないのですか? ありがとうございました。 マイケル 以下のようなシーケンスを想像してください(TrendBuffer > LoBufferのとき1、TrendBuffer < LoBufferのとき-1)。 11111111-1-1-1-1-1-1-1-111111111 矢印は、1が-1になったとき、あるいは-1が1になったとき(「状態」が変化したとき)だけ描かなければならない。そのため、それをチェック する行があります(この行は :if (state[CB] !=state[CB+1]))。つまり、状態が変化したら矢印を描く、そうでなければ矢印を描く必要はない、ということです。 arroganztrader 2013.12.29 22:22 #2119 mladenさん、こんにちは。 あなたが時間のあることを望むので、今年の終わりの近くに。 下記のコードは、前回の私の質問と関係があります。これは、プラスで2ピップを目指した後、1つの注文のために0.8ピップをトレールします。 しかし、どのように私はそれがすべての注文をチェック し、それらのために個別にトレールするようにそれを変更することができますか? ありがとうございました。ありがとうございます。 int start() { //---- if (OrdersTotal() == 0) { isStopLoss = false; } for(int i=0; i<=OrdersTotal(); i++) { if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) { continue; } if(OrdersTotal() == 0) { continue; } OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if(isStopLoss == true) { if(OrderType() == OP_BUY) { if(iClose(Symbol(), 0, 0) >= (OrderOpenPrice()+inProfitStopLoss*Point)) { // Zieht bei 2.0 Pips nach! - 200 = 2.0 Pips if(isTrailing == true) { if(iClose(Symbol(), 0, 0) >= (lastStopLoss+trailingStop)) { OrderModify(OrderTicket(), OrderOpenPrice(), (lastStopLoss+trailingStop), 0,0,0); lastStopLoss = OrderStopLoss(); //isTrailing = true; continue; } } OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+inProfitStopLoss*Point,0,0,0); if(OrderStopLoss() >= OrderOpenPrice()) { isTrailing = true; } lastStopLoss = OrderStopLoss(); } } else if(OrderType() == OP_SELL) { if(iClose(Symbol(), 0, 0) <= (OrderOpenPrice()-inProfitStopLoss*Point)) { if(isTrailing == true) { if(iClose(Symbol(), 0, 0) <= (lastStopLoss-trailingStop)) { OrderModify(OrderTicket(), OrderOpenPrice(), (lastStopLoss-trailingStop), 0,0,0); lastStopLoss = OrderStopLoss(); //isTrailing = true; continue; } } OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-inProfitStopLoss*Point,0,0,0); // 200 ursprünglich if(OrderStopLoss() <= OrderOpenPrice()) { isTrailing = true; } lastStopLoss = OrderStopLoss(); } } lastStopLoss = OrderStopLoss(); continue; } if(OrderType() == OP_BUY) { isStopLoss = true; OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-initialStopLoss*Point,0,0,0); } else if(OrderType() == OP_SELL) { isStopLoss = true; OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+initialStopLoss*Point,0,0,0); } lastStopLoss = OrderStopLoss(); } //---- return(0); } Coding help 出口戦略ステップ・ストップとトレーリング・ストップの比較 どんな新人の質問でも、フォーラムを乱雑にしないように。プロフェッショナルは、通り過ぎないでください。Nowhere without you - Mladen Rakic 2013.12.30 07:36 #2120 arroganzmaschine: やあ、mladen。年の終わりの近くでそう時間があることを望みます。 以下のコードは、私の最後の質問と関係があります。プラスで2pipsを狙った後、1つの注文に対して0.8pipsをトレールしています。 しかし、どのように私はそれがすべての注文をチェックし、それらのために個別にトレールするようにそれを変更することができますか? ありがとうございました。ありがとうございます。 int start() { //---- if (OrdersTotal() == 0) { isStopLoss = false; } for(int i=0; i<=OrdersTotal(); i++) { if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) { continue; } if(OrdersTotal() == 0) { continue; } OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if(isStopLoss == true) { if(OrderType() == OP_BUY) { if(iClose(Symbol(), 0, 0) >= (OrderOpenPrice()+inProfitStopLoss*Point)) { // Zieht bei 2.0 Pips nach! - 200 = 2.0 Pips if(isTrailing == true) { if(iClose(Symbol(), 0, 0) >= (lastStopLoss+trailingStop)) { OrderModify(OrderTicket(), OrderOpenPrice(), (lastStopLoss+trailingStop), 0,0,0); lastStopLoss = OrderStopLoss(); //isTrailing = true; continue; } } OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+inProfitStopLoss*Point,0,0,0); if(OrderStopLoss() >= OrderOpenPrice()) { isTrailing = true; } lastStopLoss = OrderStopLoss(); } } else if(OrderType() == OP_SELL) { if(iClose(Symbol(), 0, 0) <= (OrderOpenPrice()-inProfitStopLoss*Point)) { if(isTrailing == true) { if(iClose(Symbol(), 0, 0) <= (lastStopLoss-trailingStop)) { OrderModify(OrderTicket(), OrderOpenPrice(), (lastStopLoss-trailingStop), 0,0,0); lastStopLoss = OrderStopLoss(); //isTrailing = true; continue; } } OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-inProfitStopLoss*Point,0,0,0); // 200 ursprünglich if(OrderStopLoss() <= OrderOpenPrice()) { isTrailing = true; } lastStopLoss = OrderStopLoss(); } } lastStopLoss = OrderStopLoss(); continue; } if(OrderType() == OP_BUY) { isStopLoss = true; OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-initialStopLoss*Point,0,0,0); } else if(OrderType() == OP_SELL) { isStopLoss = true; OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+initialStopLoss*Point,0,0,0); } lastStopLoss = OrderStopLoss(); } //---- return(0); } アロガンツマシン この投稿からEAでトレーリングストップがどのように管理されているかを確認してください :https://www.mql5.com/en/forum/181334.トレーリングストップの処理に必要な要素(エラーチェックを含む)がすべて含まれているので、お役に立てると思います。 1...205206207208209210211212213214215216217218219...786 新しいコメント 取引の機会を逃しています。 無料取引アプリ 8千を超えるシグナルをコピー 金融ニュースで金融マーケットを探索 新規登録 ログイン スペースを含まないラテン文字 このメールにパスワードが送信されます エラーが発生しました Googleでログイン WebサイトポリシーおよびMQL5.COM利用規約に同意します。 新規登録 MQL5.com WebサイトへのログインにCookieの使用を許可します。 ログインするには、ブラウザで必要な設定を有効にしてください。 ログイン/パスワードをお忘れですか? Googleでログイン
私は期間が船体で30にしたい場合、私はチャートで2つのMAまたはhowmuch期間と1つだけ置くべきであるどのようなMVは、私は数学が得意ではありませんとあなたの努力のおかげで非常に非常に多くの男、LWMAを使用しています。
zoroxzyad
移動平均 線だけではダメです。前の投稿にある数式を使用する必要があります。
新しいメタトレーダー4のマニュアルはまだですか?
それともこれから作られるのでしょうか?
新しいメタトレーダー4のマニュアルはまだですか? それとも作るのでしょうか?
私が知っている限りではありません。あるのでしょうね(開発のどこかの時点で)。
Mladenさん、メインチャートにクロスオーバーシグナルを表示するように修正したインジケータを添付します。
このコードは新バージョンのものです。
arrDn[CB] = EMPTY_VALUE;
state[CB] = state[CB+1];
if (TrendBuffer[CB]>LoBuffer[CB]) state[CB] = 1;
if (TrendBuffer[CB]<LoBuffer[CB]) state[CB] = -1;
if (state[CB]!=state[CB+1])
{
if (state[CB]== 1) arrUp[CB] = Low[CB] -iATR(NULL,0,10,CB)/2.0;
if (state[CB]==-1) arrDn[CB] = High[CB]+iATR(NULL,0,10,CB)/2.0;
}このコードがどのようにシグナルを挿入するのか、簡単に説明する方法はありますか?
ありがとうございます。
Mladenさん、クロスオーバーのシグナルをメインチャートに表示するように改造したインジケータを添付します。
このコードは新バージョンのものです。
arrDn[CB] = EMPTY_VALUE;
state[CB] = state[CB+1];
if (TrendBuffer[CB]>LoBuffer[CB]) state[CB] = 1;
if (TrendBuffer[CB]<LoBuffer[CB]) state[CB] = -1;
if (state[CB]!=state[CB+1])
{
if (state[CB]== 1) arrUp[CB] = Low[CB] -iATR(NULL,0,10,CB)/2.0;
if (state[CB]==-1) arrDn[CB] = High[CB]+iATR(NULL,0,10,CB)/2.0;
}このコードがどのようにシグナルを挿入するのか、簡単に説明する方法はありますか?
ありがとうございます。マイケル
TrendBufferとLoBufferの2つのバッファで、値のクロスを探しているんだ。もしTrendBuffer > LoBufferなら状態を1に、TrendBuffer < LoBufferなら状態を-1にセットするんだ。
ここで、現在のバーの状態が前のバーの状態と異なる場合、それはクロスが発生していることを意味します。そして、チャート上に矢印を描画する。
また面倒な先生は、MT4のインジケーターに変換したこのインジケーターを入れてください、ありがとうございました
カラーバーズ_hlc.mq5
マイケル
TrendBufferとLoBufferの2つのバッファで、値のクロスを探している。もしTrendBuffer > LoBufferなら状態を1に、TrendBuffer < LoBufferなら状態を-1にセットします。
さて、現在のバーの状態が前のバーの状態と異なっている場合、それはクロスがあることを意味します。そして、チャート上に矢印が描かれます。さて、これでTrendBufferとLoBufferの説明がつきました。
しかし、arrUpとarrDnはどのように動作するのでしょうか?
なぜ、シグナルは 特定のローソク足で表示 され、すべてのローソク足で表示されないのでしょうか。
ありがとうございました。
これで、TrendBufferとLoBufferの説明ができました。
しかし、arrUpとarrDnはどのように機能するのでしょうか?
なぜ、シグナルは特定のローソク足で表示され、すべてのローソク足で表示されないのですか?
ありがとうございました。マイケル
以下のようなシーケンスを想像してください(TrendBuffer > LoBufferのとき1、TrendBuffer < LoBufferのとき-1)。
11111111-1-1-1-1-1-1-1-111111111
矢印は、1が-1になったとき、あるいは-1が1になったとき(「状態」が変化したとき)だけ描かなければならない。そのため、それをチェック する行があります(この行は :if (state[CB] !=state[CB+1]))。つまり、状態が変化したら矢印を描く、そうでなければ矢印を描く必要はない、ということです。
mladenさん、こんにちは。
あなたが時間のあることを望むので、今年の終わりの近くに。
下記のコードは、前回の私の質問と関係があります。これは、プラスで2ピップを目指した後、1つの注文のために0.8ピップをトレールします。
しかし、どのように私はそれがすべての注文をチェック し、それらのために個別にトレールするようにそれを変更することができますか?
ありがとうございました。ありがとうございます。
int start()
{
//----
if (OrdersTotal() == 0) {
isStopLoss = false;
}
for(int i=0; i<=OrdersTotal(); i++) {
if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) {
continue;
}
if(OrdersTotal() == 0) {
continue;
}
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(isStopLoss == true) {
if(OrderType() == OP_BUY) {
if(iClose(Symbol(), 0, 0) >= (OrderOpenPrice()+inProfitStopLoss*Point)) { // Zieht bei 2.0 Pips nach! - 200 = 2.0 Pips
if(isTrailing == true) {
if(iClose(Symbol(), 0, 0) >= (lastStopLoss+trailingStop)) {
OrderModify(OrderTicket(), OrderOpenPrice(), (lastStopLoss+trailingStop), 0,0,0);
lastStopLoss = OrderStopLoss();
//isTrailing = true;
continue;
}
}
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+inProfitStopLoss*Point,0,0,0);
if(OrderStopLoss() >= OrderOpenPrice()) {
isTrailing = true;
}
lastStopLoss = OrderStopLoss();
}
} else if(OrderType() == OP_SELL) {
if(iClose(Symbol(), 0, 0) <= (OrderOpenPrice()-inProfitStopLoss*Point)) {
if(isTrailing == true) {
if(iClose(Symbol(), 0, 0) <= (lastStopLoss-trailingStop)) {
OrderModify(OrderTicket(), OrderOpenPrice(), (lastStopLoss-trailingStop), 0,0,0);
lastStopLoss = OrderStopLoss();
//isTrailing = true;
continue;
}
}
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-inProfitStopLoss*Point,0,0,0); // 200 ursprünglich
if(OrderStopLoss() <= OrderOpenPrice()) {
isTrailing = true;
}
lastStopLoss = OrderStopLoss();
}
}
lastStopLoss = OrderStopLoss();
continue;
}
if(OrderType() == OP_BUY) {
isStopLoss = true;
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-initialStopLoss*Point,0,0,0);
} else if(OrderType() == OP_SELL) {
isStopLoss = true;
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+initialStopLoss*Point,0,0,0);
}
lastStopLoss = OrderStopLoss();
}
//----
return(0);
}やあ、mladen。
年の終わりの近くでそう時間があることを望みます。
以下のコードは、私の最後の質問と関係があります。プラスで2pipsを狙った後、1つの注文に対して0.8pipsをトレールしています。
しかし、どのように私はそれがすべての注文をチェックし、それらのために個別にトレールするようにそれを変更することができますか?
ありがとうございました。ありがとうございます。
int start()
{
//----
if (OrdersTotal() == 0) {
isStopLoss = false;
}
for(int i=0; i<=OrdersTotal(); i++) {
if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) {
continue;
}
if(OrdersTotal() == 0) {
continue;
}
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(isStopLoss == true) {
if(OrderType() == OP_BUY) {
if(iClose(Symbol(), 0, 0) >= (OrderOpenPrice()+inProfitStopLoss*Point)) { // Zieht bei 2.0 Pips nach! - 200 = 2.0 Pips
if(isTrailing == true) {
if(iClose(Symbol(), 0, 0) >= (lastStopLoss+trailingStop)) {
OrderModify(OrderTicket(), OrderOpenPrice(), (lastStopLoss+trailingStop), 0,0,0);
lastStopLoss = OrderStopLoss();
//isTrailing = true;
continue;
}
}
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+inProfitStopLoss*Point,0,0,0);
if(OrderStopLoss() >= OrderOpenPrice()) {
isTrailing = true;
}
lastStopLoss = OrderStopLoss();
}
} else if(OrderType() == OP_SELL) {
if(iClose(Symbol(), 0, 0) <= (OrderOpenPrice()-inProfitStopLoss*Point)) {
if(isTrailing == true) {
if(iClose(Symbol(), 0, 0) <= (lastStopLoss-trailingStop)) {
OrderModify(OrderTicket(), OrderOpenPrice(), (lastStopLoss-trailingStop), 0,0,0);
lastStopLoss = OrderStopLoss();
//isTrailing = true;
continue;
}
}
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-inProfitStopLoss*Point,0,0,0); // 200 ursprünglich
if(OrderStopLoss() <= OrderOpenPrice()) {
isTrailing = true;
}
lastStopLoss = OrderStopLoss();
}
}
lastStopLoss = OrderStopLoss();
continue;
}
if(OrderType() == OP_BUY) {
isStopLoss = true;
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()-initialStopLoss*Point,0,0,0);
} else if(OrderType() == OP_SELL) {
isStopLoss = true;
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOpenPrice()+initialStopLoss*Point,0,0,0);
}
lastStopLoss = OrderStopLoss();
}
//----
return(0);
}アロガンツマシン
この投稿からEAでトレーリングストップがどのように管理されているかを確認してください :https://www.mql5.com/en/forum/181334.トレーリングストップの処理に必要な要素(エラーチェックを含む)がすべて含まれているので、お役に立てると思います。