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.
-
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. -
int uncalculated_bar_lut[]={1000,10};
I have no idea what you're doing with that.
Do your lookbacks correctly #9 … #14 & #19
-
#property indicator_buffers 5 #property indicator_plots 5
There is no such thing as plots in MT4.
-
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
- Use the CODE button.
-
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. -
I have no idea what you're doing with that.
Do your lookbacks correctly #9 … #14 & #19
-
There is no such thing as plots in MT4.
-
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 codeif(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 putint 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
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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!
------------------------------------------------------------