Results 1 to 8 of 8
 1 Attachment(s)    

Thread: Change the color of an indicator

  1. #1
    Junior Member
    Join Date
    Dec 2008
    Posts
    8

    Default Change the color of an indicator

    Hello,
    Despite several attempts I can not change the color of an indicator according to the meaning of the trend.
    I like:
    if trend is positive then couleur1
    if trend is negative then couleur2

    Thank you in advance for your help.
    > permuter
    Attached Files Attached Files

  2. #2
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by domick View Post
    Hello,
    Despite several attempts I can not change the color of an indicator according to the meaning of the trend.
    I like:
    if trend is positive then couleur1
    if trend is negative then couleur2

    Thank you in advance for your help.
    > permuter
    Hi domick,

    I get an error with your indicator : incorrect input parameters.

    I have nothing on chart.

  3. #3
    Junior Member
    Join Date
    Dec 2008
    Posts
    8

    Default

    Thank you very much for your reply so fast.

    I think the problem may come from the dll.
    Did you enable this function for the indicator?

  4. #4
    Junior Member
    Join Date
    Dec 2008
    Posts
    8

    Default

    A clarification: I have the 220 version.

    Is it important?

  5. #5
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Where can I find this dll ?

  6. #6
    Junior Member
    Join Date
    Dec 2008
    Posts
    8

    Default

    May be to simplify, I send you the code.
    Thank you again for your time.


    //+------------------------------------------------------------------+
    //| Digital Low Pass (FATL/SATL, KGLP) Filter |
    //| Copyright (c) Sergey Iljukhin, Novosibirsk. |
    //| mailto:sergey@tibet.ru Генератор цифровых индикаторов и методов - цифровые фильтры, цифровая фильтрация, FATL, SATL, RBCI, RSTL, RFTL, KGLP, KGBP, Forex |
    //+------------------------------------------------------------------+
    #property copyright "Copyright (c) 2005, Sergey Iljukhin, Novosibirsk"
    #property link "mailto:sergey@tibet.ru"

    /*

    Цифровые фильтры для MetaTrader 4.

    Внимание! Для работы требуется три дополнительных DLL
    содержащих блок математической обработки - bdsp.dll, lapack.dll, mkl_support.dll,
    которые должны быть установлены в C:\Windows\System32\ или рядом с DF.dll в \experts\libraries\

    Перед использованием убедитесь:

    1. что установлены пункты "Allow DLL import" и "Confirm DLL function's call" в настройках Options->Expert Advisors
    2. Что в директории C:\Windows\System32\ имеются Bdsp.dll, lapack.dll, mkl_support.dll - вспомогательные математические библиотеки.

    Описание входных параметров:

    Ftype - Тип фильтра: 0 - ФНЧ (FATL/SATL/KGLP), 1 - ФВЧ (KGHP),
    2 - полосовой (RBCI/KGBP), 3 - режекторный (KGBS)
    P1 - Период отсечки P1, бар
    D1 - Период отсечки переходного процесса D1, бар
    A1 - Затухание в полосе задержки А1, дБ
    P2 - Период отсечки P2, бар
    D2 - Период отсечки переходного процесса D2, бар
    A2 - Затухание в полосе задержки А2, дБ
    Ripple - Биения в полосе пропускания, дБ
    Delay - Задержка, бар

    Для ФНЧ и ФВЧ значения параметрой P2,D2,A2 игнорируются
    Условия работы:
    ФНЧ: P1>D1
    ФВЧ: P1<D1
    Полосовой и режекторный: D2>P2>P1>D1

    */

    #property indicator_chart_window
    #property indicator_buffers 1
    #property indicator_color1 Red

    #import "DF.dll"
    int DigitalFilter(int FType, int P1, int D1, int A1, int P2, int D2, int A2,
    double Ripple, int Delay, double& arr[]);

    // Указываем параметры фильтра
    extern int FType=0;
    extern int P1=28;
    extern int D1=19;
    extern int A1=40;
    extern int P2=0;
    extern int D2=0;
    extern int A2=0;
    extern int Delay=0;
    extern double Ripple=0.08;
    int FilterSize=0;
    extern int BarShift=0; // Сдвиг графика, бар. Минус - назад, плюс - вперед

    //---- buffers
    double FilterResponse[], FilterBuffer[1500];

    //+------------------------------------------------------------------+
    //| Digital filter indicator initialization function |
    //+------------------------------------------------------------------+
    int init()
    {

    if(IsDllsAllowed()!=false)
    {
    //---- indicator line
    SetIndexStyle(0,DRAW_LINE);
    SetIndexBuffer(0,FilterResponse);

    // Вычисляем цифровой фильтр
    FilterSize=DigitalFilter(FType, P1, D1, A1, P2, D2, A2, Ripple, Delay, FilterBuffer);
    if (FilterSize>0) {
    SetIndexDrawBegin(0,FilterSize);
    } else Print("Incorrect input parameters. Indicator cannot run.");
    } else Print("Library call is not allowed. Indicator cannot run.");

    //----
    return(0);
    }
    //+------------------------------------------------------------------+
    //| Digital filter main function |
    //+------------------------------------------------------------------+
    int start()
    {
    int i, j, counted_bars=IndicatorCounted();

    if(IsDllsAllowed()!=false)
    {
    if (FilterSize>0) {

    //----
    if(Bars<=FilterSize) return(0);

    //----
    i=Bars-FilterSize-1;
    if(counted_bars>=FilterSize) i=Bars-counted_bars-1;
    while(i>=0)
    {
    FilterResponse[i-BarShift]=0;
    for (j=0; j<FilterSize; j++)
    FilterResponse[i-BarShift]=FilterResponse[i-BarShift]+FilterBuffer[j]*Close[i+j];

    //FilterResponse[i]=Close[i];
    i--;
    }

    } else Print("Incorrect input parameters. Indicator cannot run.");
    } else Print("Library call is not allowed. Indicator cannot run.");

    return(0);
    }

  7. #7
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    I have found the dll files but I still get the same error.

    Maybe you will find an answer to your request here :

    filters indicators - Page 7 - Forex Trading

    There are several colored digital filters.

  8. #8
    Junior Member
    Join Date
    Dec 2008
    Posts
    8

    Default

    OK thank you very much, I go there.
    Good day and good week-end

Similar Threads

  1. Daily Change indicator
    By fxtester in forum Indicators
    Replies: 0
    Last Post: 01-23-2016, 17:21
  2. Request make XOAH EA color change
    By best2004 in forum Ideas for expert advisors
    Replies: 5
    Last Post: 09-07-2010, 04:06
  3. Programming an EA to trade when this indicator changes color
    By chrisbenjy in forum MQL programming
    Replies: 0
    Last Post: 07-05-2010, 20:19
  4. (ASK) close all on candle color change
    By zoop in forum MQL programming
    Replies: 0
    Last Post: 02-24-2010, 18:15

Tags for this Thread

change, color, experts, forex, forex trading, indicator, indicators, low, main, metatrader, request, support, system, thank you, time, trading, trend

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •