all calculations of custom indicator are done right...but it doesnt plot it

 

so i am trying to  tranfer code from trading views pine script to mql4 for mt4

but all calculations of custom indicator are done right...but it doesnt plot it

here is the original script

and here is my code

plesase help!


------------------------------------------------------------


Documentation on MQL5: Language Basics / Preprocessor / Program Properties (#property)
Documentation on MQL5: Language Basics / Preprocessor / Program Properties (#property)
  • www.mql5.com
Program Properties (#property) - Preprocessor - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Forum on trading, automated trading systems and testing trading strategies

When you post code please use the CODE button (Alt-S)!

Use the CODE button

Edit your post please.
 
Sergey Golubev:
Edit your post please.
sure!
 
  1. Use the CODE button.
  2. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum?
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  3. int uncalculated_bar_lut[]={1000,10};

    I have no idea what you're doing with that.

    Do your lookbacks correctly #9#14 & #19

  4. #property indicator_buffers 5
    #property indicator_plots   5
    

    There is no such thing as plots in MT4.

  5. h_buffer[i]=high[i];
    l_buffer[i]=low[i];

    In MT4, buffers and the predefined arrays are all ordered AsSeries. There is a difference between the arrays passed to OnCalculate (e.g. low[]) and the MT4 predefined variables (e.g. Low[].) The passed arrays have no default direction, just like MT5.

    To determine the indexing direction of time[], open[], high[], low[], close[], tick_volume[], volume[] and spread[], call ArrayGetAsSeries(). In order not to depend on default values, you should unconditionally call the ArraySetAsSeries() function for those arrays, which are expected to work with.predefined variables (e.g. Low[].) The passed arrays have no default direction, just like MT5.
              Event Handling Functions - Functions - Language Basics - MQL4 Reference

 
William Roeder:
  1. Use the CODE button.
  2. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum?
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  3. I have no idea what you're doing with that.

    Do your lookbacks correctly #9#14 & #19

  4. There is no such thing as plots in MT4.

  5. In MT4, buffers and the predefined arrays are all ordered AsSeries. There is a difference between the arrays passed to OnCalculate (e.g. low[]) and the MT4 predefined variables (e.g. Low[].) The passed arrays have no default direction, just like MT5.

uncalculated_bar_lut  lut stands for look-up-table  i just want to calculate the indicator for the the previous 1000 bars and then when this is done 

by  this code




if(uncalculated_bar_signal)
     {
       uncalculated_bar=uncalculated_bar_lut[uncalculated_bar_signal];
       uncalculated_bar_signal=0;
     
     }
i will choose to recalculate the the 10 previous bar i dont want to use uncalculated_bars=total_rates-previous_calculated cause it takes a lot of computation power and my pc freezes put
int uncalculated_bar_lut[]={100,10};
and you will see it plots like 1 to 3 bars of kscore histogram and for the other ...if you hover above it it puts some extreme values
 

Can somebody tell me why i get this extreme values???

Files:
icon.PNG  27 kb