Help on Stochastic mql4 code

 
<removed>

Hello I am new to MQL4 anda trying to write the indicator above which is on tradingview, I dont have any errors but I cant plot any lines. Could you help me, what's wrong?

Files:
WDSTOS.mq4  10 kb
 
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.

Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
 
  1. #property indicator_buffers 8
    #property indicator_plots   2
    ⋮
       SetIndexBuffer(0,ALTBuffer);
       SetIndexBuffer(1,USTBuffer);
       SetIndexBuffer(2,HH);
       SetIndexBuffer(3,LL);
       SetIndexBuffer(4,stocd);
       SetIndexBuffer(5,stocv);
       SetIndexBuffer(6,HH1);
       SetIndexBuffer(7,LL1);
       SetIndexBuffer(8,sd);
       SetIndexBuffer(9,sw);

    Indicator_plots is MT5 not MT4.

  2. You declare there are eight (8) buffers, but you set index ten (10).

  3. int OnCalculate(const int rates_total,
    int Start()

    Either you use the new event calls or you use the old ones. You can't use both.

    You should stop using the old event handlers and IndicatorCounted() and start using new event handlers.
              Event Handling Functions - MQL4 Reference
              How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 2016.05.11

  4.   limit=Bars-counted_bars;
              for(i=limit; i>=0; i--)
              {
                 HH[i]=

    When counted_bars is zero, limit (and i) equals Bars. But HH[Bars] does not exist. Propgram crashes; array exceeded.
              How to do your lookbacks correctly #9 - #14 & #19

 


William Roeder:

  1. Indicator_plots is MT5 not MT4.

  2. You declare there are eight (8) buffers, but you set index ten (10).

  3. Either you use the new event calls or you use the old ones. You can't use both.

    You should stop using the old event handlers and IndicatorCounted() and start using new event handlers.
              Event Handling Functions - MQL4 Reference
              How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 2016.05.11

  4. When counted_bars is zero, limit (and i) equals Bars. But HH[Bars] does not exist. Propgram crashes; array exceeded.
              How to do your lookbacks correctly #9 - #14 & #19

Thank you, for your kind answer, I will try. 
Keith Watford:
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.

Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
thank you, I will do that all.
Reason: