[アーカイブ!】どんなルーキーの質問でも、フォーラムを散らかさないように。プロフェッショナルの皆さん、通り過ぎないでください。あなたなしではどこにも行けない - 2. - ページ 222

 
ramirez17:

エラーをご指摘ください。


0による除算 - ログブックに0除算が あるはずです。

一度目は

i+Sell_bars-1
Barsの許容サイズから外れています。
 
ramirez17, stochastics で maxima/minima を見つけ、stochastic formula をその比率に置き換える方が簡単です。
 
maxstah:

こんにちは、日足バーが異なる時刻から始まるように再描画するインジケータをどこで見つけることができるか教えてください。

例:端末の時刻が00:00の場合。インジケーターの入力パラメータに「+4」と入力します。これで日足バーが4時にスタート。

よろしくお願いします。

MT4にはコンバーターが内蔵されています。サービス→見積書アーカイブ
 

こんにちは。

初心者なので質問させてください。

オープンポジション の現在の利益データを取得する方法、現在の残高データを取得する方法。

 
Roger:
新しいピノキオは、信頼できるフィールド・オブ・ワンダーを探している、みたいな。バカにしないでください)

賢いペトロシアンがジョークを言いたいような...))
 

みんな、エラーはどこだ...すでに対処済みだ...ここにコードがある...。

変動スプレッド(もう一桁追加)のサーマルで取引すると、EAがエラー、間違ったロットを書き込みます...固定スプレッドでは、すべてが正常で、取引は...です。

 GBPUSD,H1: OrderSend error 131

が、コード自体はこんな感じです...どこがエラーなんでしょう?

 if(ExistPositions() > 0)   {
   for(cnt=0;cnt<OrdersTotal();cnt++)  { 
   OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC && OrderType()==OP_BUY)  {
         if(Ask-OrderOpenPrice() > (TrailingStop * Point))  { 
            if(OrderStopLoss() < (Ask - TrailingStop * Point)) { 
               OrderModify(OrderTicket(),
                           OrderOpenPrice(),
                           Ask - TrailingStop * Point,
                           Ask + sTakeProfit * Point,0,Aqua);
            return(0);  } // close for if(OrderStopLoss() < (Ask - TrailingStop * Point))
                        } // close for if(Ask-OrderOpenPrice() > (TrailingStop * Point))
                } // close for if(OrderSymbol()==Symbol() && OrderType()==OP_BUY)
      if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC && OrderType()==OP_SELL) {
                        if(OrderOpenPrice() - Bid > (TrailingStop * Point))   { 
                                if(OrderStopLoss() > (Bid + TrailingStop * Point))   { 
                           OrderModify(OrderTicket(),
                                       OrderOpenPrice(),
                                       Bid + TrailingStop * Point,
                                       Bid - sTakeProfit * Point,0,Magenta);
            return(0);  } 
                        } // close for if(OrderOpenPrice() - Bid > (TrailingStop * Point))
                 } // close for if(OrderSymbol()==Symbol() && OrderType()==OP_SELL)
          } // close for for(cnt=0;cnt<total;cnt++)
   } // close for if(TradesThisSymbol > 0)
}

bool ExistPositions() {
        for (int i=0; i<OrdersTotal(); i++) {
                if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
                        if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) {
                                return(True);
                        }
                } 
        } 
        return(false);
}



void OpenBuy() { 
   double ldLot, ldStop, ldTake; 
   string lsComm; 
   ldLot = GetSizeLot(); 
   ldStop = GetStopLossBuy(); 
   ldTake = GetTakeProfitBuy(); 
   lsComm = GetCommentForOrder(); 
   OrderSend(Symbol(),OP_BUY,ldLot,Ask,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenBuy); 
   if (UseSound) PlaySound(NameFileSound); 
} 
void OpenSell() { 
   double ldLot, ldStop, ldTake; 
   string lsComm; 

   ldLot = GetSizeLot(); 
   ldStop = GetStopLossSell(); 
   ldTake = GetTakeProfitSell(); 
   lsComm = GetCommentForOrder(); 
   OrderSend(Symbol(),OP_SELL,ldLot,Bid,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenSell); 
   if (UseSound) PlaySound(NameFileSound); 
} 
string GetCommentForOrder() {   return(Name_Expert); } 
double GetSizeLot() {   return(Lots); } 
double GetStopLossBuy() {       return (Bid-sStopLoss*Point);} 
double GetStopLossSell() {      return(Ask+sStopLoss*Point); } 
double GetTakeProfitSell() {    return(Bid-sTakeProfit*Point); } 
double GetTakeProfitBuy() {     return(Bid+sTakeProfit*Point); } 

return(0);

//+------------------------------------------------------------------+
 
Vovo4ka:

賢いペトロシアンがジョークを言いたいような...))

www.dukascopy.com mt4 and java technology, minimum deposit is 1000 greenbacks, found recently myself.
 
todem:

www.dukascopy.com mt4とjavaの技術、最小デプト1000グリーン、最近自分で発見しました。

ありがとうございました。
 
もし、インジケータがsleepで 無限ループになっているのであれば、if(!deinit)のような関数を挿入する必要があるのでは?
 
Vovo4ka:

みんな、エラーはどこだ...すでに対処済みだ...これがそのコードだ...。

スプレッドが変動している(もう一桁増えている)サーマルで取引すると、アドバイザーが間違ったロットを書き込む...。

が、コード自体はこんな感じです...どこがエラーなんでしょう?


ロットノーマライズを行う

double GetSizeLot() {   return(NormalizeDouble(Lots,2)); }