So zeichnen Sie alle 10 Pips eine Referenzlinie - Seite 4

 

Es ist okay,

Ich habe es zum Laufen gebracht ...!! 8)

Vielen Dank an diejenigen, die die Ideen dazu beigesteuert haben.

 

Das Ergebnis.... bei 10pips pro bar.

für mich seine viel einfacher auf die Augen als die Standard-Raster, und dauert eine halbe Sekunde zu sehen, wie viele Pips Bewegung youre Blick auf.

neue Balken .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);
    }
}



//---

Es funktioniert nicht. Viele Fehler. Was muss behoben werden?

Auch, wenn es höhere Zeitrahmen geht, möchte ich es geändert werden,

===> 1Min ~ 30 Min ==> alle 10 Pips

===> 1 Hour ======> alle 50 Pips

===> 4 Hour, Daily ======> alle 100 Pips

===> Wöchentlich, Monatlich ===> alle 1000 Pips

Jede Hilfe? Anstelle von Linien sind Rechtecke erwünscht, was zu Verwechslungen mit Widerstandslinien und Unterstützungslinien führen kann.

Bitte helfen Sie, vielen Dank im Voraus ~