Как определить цвет фона у терминала? - страница 3

 
banderass:
xeon
пробывал и так и так, никакой разницы (

//+------------------------------------------------------------------+
//|                                                         j003.mq4 |
//|                                   Copyright © 2007, Antonuk Oleg |
//|                                                   banderass@i.ua |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, Antonuk Oleg"
#property link      "banderass@i.ua"
 
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Yellow
#property indicator_color2 Green
#property indicator_color3 Yellow
#property indicator_color4 Green
#property indicator_color5 Gray
 
#import "user32.dll"
   int GetDC(int hwnd);
   int ReleaseDC(int hwnd,int hdc);
#import "gdi32.dll"
 int GetPixel(int hdc,int x,int y);
#import
 
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
    int hwnd=WindowHandle(Symbol(),Period());
   int hdc=GetDC(hwnd);
   int back_ground=GetPixel(hdc,1,2);
   ReleaseDC(hwnd,hdc);
 
 
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);   
   SetIndexStyle(2,DRAW_HISTOGRAM);
   SetIndexStyle(3,DRAW_HISTOGRAM);
   SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,2,back_ground);
   
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexBuffer(3,ExtMapBuffer4);
   SetIndexBuffer(4,ExtMapBuffer5);
   
   IndicatorShortName("justTest");
   
   int windowIndex=WindowFind("justTest");
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
     int limit;
     int counted_bars=IndicatorCounted();
  //---- последний посчитанный бар будет пересчитан
     if(counted_bars>0) counted_bars--;
     limit=Bars-counted_bars;
  //---- основной цикл
     for(int i=0; i<limit; i++)
     {
         ExtMapBuffer1[i]=iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i);
         ExtMapBuffer2[i]=iMA(NULL,0,8,2,MODE_SMMA,PRICE_MEDIAN,i);
         
         if(ExtMapBuffer1[i]>ExtMapBuffer2[i])
            ExtMapBuffer3[i]=ExtMapBuffer1[i];
         else
            ExtMapBuffer4[i]=ExtMapBuffer2[i];
 
         ExtMapBuffer5[i]=MathMin(ExtMapBuffer1[i],ExtMapBuffer2[i]);         
     }
 
//----
   return(0);
  }
//+------------------------------------------------------------------+

Не помню что было, может быть и ничего, но вот так работает у меня.

Мне больше нравится еще один буфер серого цвета пунктиром под самый низ, затем сверху еще один, чтобы закрасить ненужное - получается как сетка.

 
Integer
взял ваш код, откомпилил, ничего не отображалось как ранее. И тут меня "осенило" посмотреть в лог ))



Тема закрыта. Всем большое спасибо за универсальное решение!
Причина обращения: