double highest_open_price=0;
int highest_Ticket=-1;
for(int pos=OrdersTotal()-1; pos>=0; pos--)
if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES) // Only my orders w/
&& OrderMagicNumber()==0// my magic number
&& OrderSymbol()==Symbol() // and my pair.
&& OrderOpenPrice()>=highest_open_price)
{
highest_open_price=OrderOpenPrice();
highest_Ticket=OrderTicket();
}
RefreshRates();
if (Bid>=highest_open_price+10*Point)
highest_Ticket=OrderSend(Symbol(),OP_SELL,mylot(),Bid,0,0,0,"My Comment",0,0,Red);
}
double highest_open_price=0;
int highest_Ticket=-1;
for(int pos=OrdersTotal()-1; pos>=0; pos--)
if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES) // Only my orders w/
&& OrderMagicNumber()==0// my magic number
&& OrderSymbol()==Symbol() // and my pair.
&& OrderOpenPrice()>=highest_open_price)
{
highest_open_price=OrderOpenPrice();
highest_Ticket=OrderTicket();
}
int look_pips=0;
for(pos=OrdersTotal()-1; pos>=0; pos--)
highest_open_price=MathAbs(High[pos]-Low[pos])/Point; //pips levels of the barif (Bid>=highest_open_price && look_pips >=my_pips)
Print("The last price movement more than ",my_pips);
RefreshRates();
highest_Ticket=OrderSend(Symbol(),OP_SELL,mylot(),Bid,0,0,0,"My Comment",0,0,Red);
double highest_open_price=0;
int highest_Ticket=-1;
for(int pos=OrdersTotal()-1; pos>=0; pos--)
if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES) // Only my orders w/
&& OrderMagicNumber()==0// my magic number
&& OrderSymbol()==Symbol() // and my pair.
&& OrderOpenPrice()>=highest_open_price)
{
highest_open_price=OrderOpenPrice();
highest_Ticket=OrderTicket();
}
double tickvalue = (MarketInfo(Symbol(),MODE_TICKVALUE));
if(Digits == 5 || Digits == 3){
tickvalue = tickvalue*10;
}
if (Bid>=highest_open_price + tickvalue*10)
Print("The last price movement more than ",tickvalue);
RefreshRates();
highest_Ticket=OrderSend(Symbol(),OP_SELL,mylot(),Bid,0,0,0,"My Comment",0,0,Red);
now to add my comment on this tick value. one thing i know is -----10pips is a movement of price upward or down to definite number point stored while 10tick
is count of moving price without storing number
else 10tick can complete in 1 candle far below pips. while 10pips can complete in more than 20bars/candle or even 1bar/candle.
conclusion i dont think i got it right?
please point me through
in addition double MYPIP= MarketInfo(Symbol(), MODE_DIGITS); can it work on this case to get pip
double highest_open_price=0;
int highest_Ticket=-1;
for(int pos=OrdersTotal()-1; pos>=0; pos--)
if(OrderSelect(0,SELECT_BY_POS,MODE_TRADES) // Only my orders w/
&& OrderMagicNumber()==0// my magic number
&& OrderSymbol()==Symbol() // and my pair.
&& OrderOpenPrice()>=highest_open_price)
{
highest_open_price=OrderOpenPrice();
highest_Ticket=OrderTicket();
}
double PipDecimal=Point;
if(Digits == 5 || Digits == 3)
PipDecimal = PipDecimal*10;
if (Bid>=highest_open_price + PipDecimal *10)
Print("The last price movement more than ",PipDecimal);
RefreshRates();
highest_Ticket=OrderSend(Symbol(),OP_SELL,mylot(),Bid,0,0,0,"My Comment",0,0,Red);
if (Bid>=highest_open_price + PipDecimal *10)
{
Print("The last price movement more than ",PipDecimal);
RefreshRates();
highest_Ticket=OrderSend(Symbol(),OP_SELL,mylot(),Bid,0,0,0,"My Comment",0,0,Red);
}
はい、私は10ピップス 欲しいです。
そして、私が追加したこの条件が正しいかどうかもチェックしてください。
迷子の}でコードを投稿しないでください。
これは混乱を招くのでやめてください。
あなたのEAをストラテジーテスターで試してみれば、あなたが正しいかどうかわかるでしょう。
} -- WHRoeder さんからのご指摘で 訂正しました。ご指摘ありがとうござい ます。
WHRoeder:さんの指摘の通り、 ポイントとpipsについて、高値が 出た今、 pipsを 考慮すべきと 思います。
今、私は高値が得られたので、私のpipsをどのように計算したかを見てください............私は正しいですか?
my_pipsは extern double my_pips =10; で追加されていることを思い出してください。何をしようとしているのか、さっぱりわかりません。
最初のループでhighest_open_priceの 値を取得します。
その後、再び注文をループして別の値を与える
なぜ?
何をしようとしているのか、さっぱりわかりません。
最初のループでhighest_open_priceの 値を取得します。
その後、再び注文をループして別の値を与える
なぜ?
申し訳ありません、あなたの投稿を見る前に書き直そうとしたのですが、間違いでした。
今はティック値でpipsを計算しています.......
修正ありがとうございます。
今、私はコードを結合しました。最高値はpipsが取得されます。
バックテストをしたのですが、結果がコードと一致しないのです。
それとも、マーケットを閉じたからでしょうか...ありがとうございます。
それとも doublePipDecimal = (MarketInfo(Symbol(),MODE_DIGITS)); が考慮されるべきでしょうか。
中括弧がない場合、新しい取引は、すべてのティックに開かれます。
それは素晴らしい!それはうまくいきました...完璧にスポッティング。
しかし、唯一の問題は、最初の注文が成功 した後、2番目の 注文の間に、再び複数の注文を開き続けることです...よく開いた。
私は間違っていた何かがあるしてください。