コーディングのヘルプ - ページ 212

 
zoroxzyad:
私は期間が船体で30にしたい場合、私はチャートで2つのMAまたはhowmuch期間と1つだけ置くべきであるどのようなMVは、私は数学が得意ではありませんとあなたの努力のおかげで非常に非常に多くの男、LWMAを使用しています。

zoroxzyad

移動平均 線だけではダメです。前の投稿にある数式を使用する必要があります。

 

新しいメタトレーダー4のマニュアルはまだですか?

それともこれから作られるのでしょうか?

 
techmac:
新しいメタトレーダー4のマニュアルはまだですか? それとも作るのでしょうか?

私が知っている限りではありません。あるのでしょうね(開発のどこかの時点で)。

 

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;

}

このコードがどのようにシグナルを挿入するのか、簡単に説明する方法はありますか?

ありがとうございます。

ファイル:
 
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にセットするんだ。

ここで、現在のバーの状態が前のバーの状態と異なる場合、それはクロスが発生していることを意味します。そして、チャート上に矢印を描画する。

 

また面倒な先生は、MT4のインジケーターに変換したこのインジケーターを入れてください、ありがとうございました

カラーバーズ_hlc.mq5

ファイル:
 
mladen:
マイケル

TrendBufferとLoBufferの2つのバッファで、値のクロスを探している。もしTrendBuffer > LoBufferなら状態を1に、TrendBuffer < LoBufferなら状態を-1にセットします。

さて、現在のバーの状態が前のバーの状態と異なっている場合、それはクロスがあることを意味します。そして、チャート上に矢印が描かれます。

さて、これでTrendBufferとLoBufferの説明がつきました。

しかし、arrUpとarrDnはどのように動作するのでしょうか?

なぜ、シグナルは 特定のローソク足で表示 され、すべてのローソク足で表示されないのでしょうか。

ありがとうございました。

 
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]))。つまり、状態が変化したら矢印を描く、そうでなければ矢印を描く必要はない、ということです。

 

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);

}
 
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.トレーリングストップの処理に必要な要素(エラーチェックを含む)がすべて含まれているので、お役に立てると思います。