[ARCHIVE]フォーラムを乱立させないために、どんなルーキーの質問でも。プロフェッショナルの皆さん、通り過ぎないでください。あなたなしではどこにも行けない - 5. - ページ 351

 
Heroix:
でも、早いですね。自分で見つけたので投稿を削除。ありがとうございました。

お久しぶりです!見つからない古い投稿に返信したつもりが... :)
 
tara:
そして、「ツール - 設定」メニューの「イベント」タブでは、かなりひどい状況になっていますが。使ってみてください :(

そうですね、まずいですね・・・。アラートはスペースキーではオフにならず、手動でのみオフになります ...service-settings-events」のalertパラメータを変更しても、何も起こらない.
 

みんな、ヒントをください。すでに質問しているのですが、コードがうまくいきません。

もう一度、そのアイデアの要点をお伝えします。Awesomインジケータにより、ボトム(0以下)からトップ(0以上)まで、波のボリューム(インジケータVolumes)を計算します。

波動の体積の合計を示すテキストラベルは、インジケータ・チャートに印刷され、全履歴にわたって計算されるはずです。

これを手に入れた。

イチジク

エラーは何ですか?

#property  indicator_separate_window
#property  indicator_buffers 2
#property  indicator_color1  Red
#property  indicator_color2  SteelBlue
#property  indicator_width1  2

//---- basic fan indicator parameters

extern bool Show_AOLine_2=true;
extern int SlowEMA3=34;
extern int EMA=3;
extern bool Show_Volume=true;
extern double coaf=0.5;
//---- indicator buffers
double AOBuffer3[];
double ExtMapBuffer1[];


    double VLUP, AO_up,AO_dn;
    double prhgh_e=0, prhgh_s, prlw_e=0, prlw_s;
    datetime tmhgh, tmlw;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   //---- drawing settings
   
  string name_ind = "Awesome_super_volumes";
   IndicatorShortName("Awesome_super_volumes");
   
   
//---- AO_fan line 2 (basic)
   if(Show_AOLine_2 ==true){Show_AOLine_2=DRAW_LINE; }
   else 
    {Show_AOLine_2=DRAW_NONE; }
   SetIndexBuffer(0,AOBuffer3);
   SetIndexStyle(0,Show_AOLine_2);
   SetIndexLabel(0,"basic line");   

   SetIndexBuffer(1,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexLabel(1,"Volume");
   
  //---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Awesome Oscillator                                               |
//+------------------------------------------------------------------+
int start()
  {
  
   int    limit;
   int    counted_bars=IndicatorCounted();
   double prev,current;
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;

   for(int i=0; i<limit; i++)
   {
     
 //---- AO_fan + Volumes
     
AOBuffer3[i]=iMA(NULL,0,EMA,0,MODE_SMA,PRICE_MEDIAN,i)-iMA(NULL,0,SlowEMA3,0,MODE_SMA,PRICE_MEDIAN,i);
if (Show_Volume==true)
{
double nSum = Volume[i]*Point*coaf;
   if (AOBuffer3[i]<=0)ExtMapBuffer1[i] = nSum;
   if (AOBuffer3[i]>0)ExtMapBuffer1[i] = -nSum;


double Vol_Arr[];
  if (AOBuffer3[i]<=0)Vol_Arr[i]=Volume[i]*Point*coaf;
  if (AOBuffer3[i]>0)Vol_Arr[i] = -Volume[i]*Point*coaf;
}
}

  //-- Поиск High & Time & Min_AO  
  if (AOBuffer3[i]>0)
  {
    
  AO_up = AOBuffer3[i]*0.1+AOBuffer3[i];
  prhgh_s = High[i];
  if (prhgh_s >= prhgh_e) {prhgh_e = prhgh_s; tmhgh = Time[i];}
  //SetText("Awesome_super_volumes"+Close[i], DoubleToStr(VLUP,0), tmhgh, AO_up, Black);
  }   
   
  //-- Поиск Low & Time & Max_AO 
  if (AOBuffer3[i]<0)
  {
  AO_dn = AOBuffer3[i]*0.1+AOBuffer3[i];
  prlw_s = Low[i];
  if (prlw_s > prlw_e) {prlw_e = prlw_s; tmlw = Time[i];}
  //SetText("Awesome_super_volumes"+Close[i], DoubleToStr(VLUP,0), tmlw, AO_dn, Black);
  } 
  
  // -- Пересчет баров от High до Low
  
  if(NewBar())
{ 
int colbr = iBarShift(NULL,0,tmhgh)-iBarShift(NULL,0,tmlw);     
int shift=iBarShift(NULL,0,tmhgh);
 for (i=0; i<=colbr; i++)
{VLUP += MathAbs(iVolume(NULL,0, shift+i));}
}


    
   Comment("Vol_",VLUP,prlw_e,prhgh_e); 
  for(i=0; i<limit; i++)
   {     
SetText("Awesome_super_volumes"+Close[i], DoubleToStr(VLUP,0), tmlw, AO_dn, Black);     
 }
        
//---- done
   return(0);
  }
//+------------------------------------------------------------------+
void SetText(string name, string Vl, datetime t1, double p1, color c)
 {
 // if (ObjectFind(name)!=-1) ObjectDelete(name);
  ObjectCreate(name,OBJ_TEXT,WindowFind("Awesome_super_volumes"),0,0,0,0);
  ObjectSetText(name, Vl, 10, "Times New Roman", c);
  ObjectSet(name, OBJPROP_TIME1 , t1);
  ObjectSet(name, OBJPROP_PRICE1, p1);
  ObjectSet(name, OBJPROP_COLOR, c); 
  }
  
  bool NewBar()
{
   static datetime lastbar = 0;
   datetime curbar = Time[0];
   if(lastbar!=curbar)
   {
      lastbar=curbar;
      return (true);
   }
   else
   {
    return(false);
   }}
 

EAがチャート上に注文の束を投げる。

私の関数は、オープンマーケットオーダー、保留中のビッド、および決済の数を見つけます。もう一つ早く確認するために、保留中の注文の最大価格と最小価格の値を見つける組み込み関数を追加しました。

ある瞬間に、私が望むものではない価値観を見出すことが、プリントを通して見えてくるのです。

保留中の注文がすでに決済されている場合、それらをスキップする必要があるが、この関数は何らかの理由でスキップしない、というものである。以下はその機能です。

//+-------------------------------------------------------------------------------------+
//| Поиск своих ордеров                                                                 |
//+-------------------------------------------------------------------------------------+
void FindOrders()
{
   int total = OrdersTotal() - 1;
   
   amountOfCurrPendingBuys = 0;
   amountOfCurrPendingSells = 0;
   amountOfCurrMarketOrders = 0;
   
   priceMinOfBuy = 0;
   priceMaxOfSell = 0;

   for (int i=total; i>=0; i--)
   {
     if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
        if (OrderSymbol() != Symbol()) continue;
           if (OrderMagicNumber() != i_magic) continue;
           if (OrderCloseTime() != 0) continue;
           {
              if (OrderType() == OP_BUYSTOP)
              {
                 amountOfCurrPendingBuys++;

                 if (priceMaxOfBuy < OrderOpenPrice() || priceMaxOfBuy == 0)
                 {
                     priceMaxOfBuy = OrderOpenPrice();
                 }
                 if (priceMinOfBuy > OrderOpenPrice() || priceMinOfBuy == 0)
                 {
                     priceMinOfBuy = OrderOpenPrice();
                 }
              }
              if (OrderType() == OP_SELLSTOP)
              {
                 amountOfCurrPendingSells++;

                 if (priceMaxOfSell < OrderOpenPrice() || priceMaxOfSell == 0)
                 {
                     priceMaxOfSell = OrderOpenPrice();
                 }
                 if (priceMinOfSell > OrderOpenPrice() || priceMinOfSell == 0)
                 {
                     priceMinOfSell = OrderOpenPrice();
                 }
              }
              amountOfCurrMarketOrders++;
           }
   }
   Print("FindOrders() : priceMaxOfBuy ", priceMaxOfBuy);
   Print("FindOrders() : priceMinOfBuy ", priceMinOfBuy);
   Print("FindOrders() : priceMaxOfSell ", priceMaxOfSell);
   Print("FindOrders() : priceMinOfSell ", priceMinOfSell);
   
   Print("FindOrders() : amountOfCurrPendingBuys ", amountOfCurrPendingBuys);
   Print("FindOrders() : amountOfCurrPendingSells ", amountOfCurrPendingSells);
   Print("FindOrders() : amountOfCurrMarketOrders ", amountOfCurrMarketOrders);
}

条件が整っている

if (OrderCloseTime() != 0) continue;

つまり、注文の終了時刻が0でなければ、その注文は終了しており、スキップするべきだということです。

出力では、スキップしないんですね。これがそのチャートです。

なぜ、間が悪いと値段がつくのか?なぜなら、私が見たところ、コードは正しいからです。

 
hoz:

私が持っている条件は、はっきりと明記されています。

if (OrderCloseTime() != 0) continue;


フォワードはどうする?
 
Vinin:

保留中の注文についてはどうなっていますか?


そのため、有効な注文の終値は 論理的にゼロになりますが(決済されていないため)、すでに決済された注文の終値はゼロではありません(終値は削除された時点のものとなります)。論理的に考えて、これが閉店時間?

保留中の注文がクローズされずに削除されるのは理解できますが、他にどのように実装すればよいのでしょうか?

 
最外周のペンダントを見つけるという関数に何を求めているのか、書いていただけますか?
 
//+-------------------------------------------------------------------------------------+
//| Поиск своих ордеров                                                                 |
//+-------------------------------------------------------------------------------------+
void FindOrders()
{
   int total = OrdersTotal() - 1;
   
   amountOfCurrPendingBuys = 0;
   amountOfCurrPendingSells = 0;
   amountOfCurrMarketOrders = 0;
   
   priceMinOfBuy = 0;
   priceMaxOfSell = 0;

   for (int i=total; i>=0; i--)
   {
     if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
        if (OrderSymbol() != Symbol()) continue;
           if (OrderMagicNumber() != i_magic) continue;
           if (OrderCloseTime() != 0) continue;
           {// к чему относятся эти скобки ??? уберите их и if (OrderCloseTime() != 0) continue; наконец то заработает
              if (OrderType() == OP_BUYSTOP)
              {
                 amountOfCurrPendingBuys++;

                 if (priceMaxOfBuy < OrderOpenPrice() || priceMaxOfBuy == 0)
                 {
                     priceMaxOfBuy = OrderOpenPrice();
                 }
                 if (priceMinOfBuy > OrderOpenPrice() || priceMinOfBuy == 0)
                 {
                     priceMinOfBuy = OrderOpenPrice();
                 }
              }
              if (OrderType() == OP_SELLSTOP)
              {
                 amountOfCurrPendingSells++;

                 if (priceMaxOfSell < OrderOpenPrice() || priceMaxOfSell == 0)
                 {
                     priceMaxOfSell = OrderOpenPrice();
                 }
                 if (priceMinOfSell > OrderOpenPrice() || priceMinOfSell == 0)
                 {
                     priceMinOfSell = OrderOpenPrice();
                 }
              }
              amountOfCurrMarketOrders++;
           }
   }
   Print("FindOrders() : priceMaxOfBuy ", priceMaxOfBuy);
   Print("FindOrders() : priceMinOfBuy ", priceMinOfBuy);
   Print("FindOrders() : priceMaxOfSell ", priceMaxOfSell);
   Print("FindOrders() : priceMinOfSell ", priceMinOfSell);
   
   Print("FindOrders() : amountOfCurrPendingBuys ", amountOfCurrPendingBuys);
   Print("FindOrders() : amountOfCurrPendingSells ", amountOfCurrPendingSells);
   Print("FindOrders() : amountOfCurrMarketOrders ", amountOfCurrMarketOrders);
}
 
int i, buy_ticket,sell_ticket;
double min = Close[0];
double max = Close[0];
for(i = OrdersHistoryTotal()-1;i>=0;i--){
   if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
      if(OrderSymbol()!=Symbol()){continue;}
      if(OrderMagicNumber()!=Magic){continue;}
      if(OrderType()==OP_BUYSTOP){
         if(OrderOpenPrice()>max){
            max = OrderOpenPrice();
            buy_ticket = OrderTicket();
         }
      }
      if(OrderType()==OP_SELLSTOP){
         if(OrderOpenPrice()<min){
            min = OrderOpenPrice();
            sell_ticket = OrderTicket();
         }
      }
   }
}
if(OrderSelect(buy_ticket,SELECT_BY_TICKET){
   if(OrderCloseTime()==0){OrderDelete(OrderTicket());}
}
if(OrderSelect(sell_ticket,SELECT_BY_TICKET){
   if(OrderCloseTime()==0){OrderDelete(OrderTicket());}
}
 
FAQ:
最も外側にある保留中の注文を見つけるという関数に何を求めているかを書いていただけますか?

最外周の保留中の注文の価格を検索する。アクティブなものであって、削除されたものではありません。例えば、削除された保留中の注文をスキップして検索したいのですが・・・。ご理解いただけたでしょうか?