10Pips毎の基準線の引き方 - ページ 4

 

その大丈夫です。

私はそれを動作させることができました......! 8)

このアイデアを提供してくれた人たちに感謝します。

 

結果は...バーあたり10pipsです。

私にとっては、デフォルトのグリッドよりはるかに目に優しく、何pipsの動きがあるか確認するのに半秒かかります。

ニューバー.mq4

 
//+------------------------------------------------------------------+
//|                                                       bgColorChanges10_20_30_40_50.mq4 |
//|                      Copyright ?2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2009, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#define  ONDA_BEGINS   0
#define  ONDA_CONTAINS 1


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
    for (int ix = 0; ix < nLines; ix++) // delete my horizontal lines
      {
      ObjectDelete("tensLines"+ix);
      }

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    int nLines = 40;                                   // Number of total line to draw
   double lineInterval = 0.0010;                      // Interval between lines
   double normPrice = NormalizeDouble(Close[1],3);    // Current price is rounded to nearest "10"

   for (int ix = 0; ix < nLines; ix++)                // Loop span number of times
      {
      if(ObjectFind("tensLines"+ix) < 0) 
         ObjectCreate("tensLines"+ix, OBJ_HLINE, 0, 0, normPrice+((ix-(nLines/2))*lineInterval));    // Place half above and half below the current price

      else ObjectSet("tensLines"+ix, OBJPROP_PRICE1, normPrice+((ix-(nLines/2))*lineInterval));
      ObjectSet("tensLines"+ix,OBJPROP_COLOR,DarkSlateGray);      // Make the lines look better
      }
 
//----
   return(0);
  }
//+------------------------------------------------------------------+

void ObjectNameDeleteAll(string name, int where=ONDA_BEGINS, int type=EMPTY)
{
    for(int iObj=ObjectsTotal()-1; iObj >= 0; iObj--)
    {
        string on   = ObjectName(iObj);
        int    iPos = StringFind(on, name);
        if (iPos < 0)                         continue;
        if (iPos > 0 && where == ONDA_BEGINS) continue;
        if      (type == EMPTY))         ObjectDelete(on);
        else if (type == ObjectType(on)) ObjectDelete(on);
    }
}



//---

うまくいかない、エラーが多い。 修正する必要があるのは?

あと、上位のタイムフレームになったら、変更して欲しいです。

===> 1分〜30分============10pips毎

===> 1時間足==============================50pips毎

===> 4時間足、日足 ========== 100pips毎

===> 週足、月足 ===> 1000pips毎

何かお手伝いできることはありますか?抵抗線、支持線と混同する可能性があるので、線の代わりに長方形を希望します。

助けてください、よろしくお願いします〜。