Can anyone help to fix this Pip-count indior?

thread: Can anyone help to fix this Pip-count indior?

  1. #1
    Junior Member hamzaFaris's Avatar
    21

    Can anyone help to fix this Pip-count indicator?

    Dear All,

    This up/down PIPs count indior counts at first the lead bid rate. It must count 0 up down pips at starting of count and after that it's to count normally. Starting first counting bar is the problem can some 1 fix this situation? The indior is under attached.

    Regards,

    Vinay

    #property indior_separate_window
    #property indior_buffers 2
    #property indior_color1 Green
    #property indior_color2 Crimson
    //-- buffers
    //extern int MaxDrawBars=20;
    double ExtMapBuffer1[];
    double ExtMapBuffer2[];
    double CurrentTick;
    double PreviousTick;
    // ------------------------------------------------------------------
    //| Custom indior initialization function |
    // ------------------------------------------------------------------
    int init()

    //-- indiors
    SetIndexStyle(0,DRAW_HISTOGRAM);
    SetIndexBuffer(0, ExtMapBuffer1);
    SetIndexEmptyValue(0,0.0);

    SetIndexStyle(1,DRAW_HISTOGRAM);
    SetIndexBuffer(1, ExtMapBuffer2);
    SetIndexEmptyValue(1,0.0);

    SetIndexDrawBegin(0,1);
    SetIndexDrawBegin(1,1);


    //--
    return(0);

    // ------------------------------------------------------------------
    //| Custom indior deinitialization function |
    // ------------------------------------------------------------------
    int deinit()

    //--

    //--
    return(0);

    // ------------------------------------------------------------------
    //| Custom indior iteration serve |
    // ------------------------------------------------------------------
    int start()

    int I, limit=1;

    PreviousTick = CurrentTick;
    CurrentTick = Bid;

    //--
    for(I = 0; I lt; limit; I )

    if(CurrentTick gt; PreviousTick) ExtMapBuffer1 = CurrentTick - PreviousTick;
    if(CurrentTick lt; PreviousTick) ExtMapBuffer2 = PreviousTick - CurrentTick;


    return(0);

    // ------------------------------------------------------------------

  2. #2
    ExtMapBuffer1 and ExtMapBuffer2 are arrays, so in the event that you assign a value for them, you need to use [], in such a case maybe ExtMapBuffer1
    I notice that the text has changed to italics, please visit this post
    https://www.cliqforex.com/trading-sy...nect-fxcm.html

  3. #3
    Junior Member hamzaFaris's Avatar
    21
    Dear all,

    ExtMapBuffer1 ExtMapBuffer are arrays just, nevertheless during attaching the indior ExtMapBuffer1 is only showing the bid value rather I need to assign zero for the two ExtMapBuffer1 ExtMapBuffer2 before beginning.

    Starting Bid value ought to be prevented. Kindly correct the bug in this indior

    https://www.cliqforex.com/attachment...1774199533.mq4

  4. #4
    Junior Member hamzaFaris's Avatar
    21
    If possible someone can correct this indior?

  5. #5
    Junior Member alitaoxrgog's Avatar
    26
    Dear All, This up/down PIPs count indior counts at first the direct bid rate. It has to count 0 for both up down pips at beginning of count and after that it has to rely normally. Beginning first counting bar is the problem can some 1 fix this situation? The indior is below also attached. Regards, Vinay #property indior_separate_window #property indior_buffers two #property indior_color1 Green #property indior_color2 Red //-- buffers //extern int MaxDrawBars=20; double ExtMapBuffer1[]; double ExtMapBuffer2[]; double CurrentTick; double...
    you have multiple difficulties with this code...

    firstly, if you would like to COUNT the ticks then it is no good adding/subtracting the price value of the bid. You have to simply do Tick or Tick-- depending of the bid is greater or less than last.

    It won't work on historical bars as MT4 doesn't store ticks.

    Etc etc..

    Should you do a search of the web this indior has been written many times before.

  6. #6
    ExtMapBuffer1 and ExtMapBuffer2 are arrays, so in the Event That You assign a value for them, you need to use [], in this case Possibly ExtMapBuffer1

  •