Hi,
I would like to ask for help to correct the code. Basically I have made a private indicator in Pine Language. I converted that indicator to mql5. But It shows lots of errors. Due to 0 knowledge in Mql5 language, I stucked and requires Help from Experts. Thanks
Code is here and File is attached as well:
You may be lucky and someone helps you. But you should create a freelance order.
One thing to say is you do not access arrays the way you did.
-
You need to learn
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
-
int limit = rates_total - prev_calculated; if (limit <= 0) return(0); int i; for (i = 0; i < limit; i++)
Decide whether you are reading as series or not. Determine your lookback amounts.
How to do your lookbacks correctly #9 — #14 & #19 (2016) -
WVF[i] = ((iLowest(close, rates_total, LookBackPeriodStandardDeviationHighLow) - high[i]) / (iLowest(close, rates_total, LookBackPeriodStandardDeviationHighLow))) * 100; WVF2[i] = ((iHighest(close, rates_total, LookBackPeriodStandardDeviationHighLow) - low[i]) / (iHighest(close, rates_total, LookBackPeriodStandardDeviationHighLow))) * 100;
Perhaps you should read the manual. What do iLowest/iHighest return?
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up. - To define the indexing direction in the time[], open[], high[], low[], close[], tick_volume[], volume[] and spread[] arrays, call the ArrayGetAsSeries() function. In order not to depend on defaults, call the ArraySetAsSeries() function for the arrays to work with.
Event Handling / OnCalculate - Reference on algorithmic/automated trading language for MetaTrader 5 -
SDev[i] = iBands(close, BollingerBandLength, BollingerBandStandardDeviationUpDown, MODE_UPPER, i); SDev2[i] = iBands(close, BollingerBandLength, BollingerBandStandardDeviationUpDown, MODE_LOWER, i); }
Perhaps you should read the manual, especially the examples.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick/OnCalculate (after the indicator has updated its buffers), you use the handle, shift and count to get the data.
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 (2020)
How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 (2020)
MQL5 for Newbies: Guide to Using Technical Indicators in Expert Advisors - MQL5 Articles (2010)
How to call indicators in MQL5 - MQL5 Articles (2010)
-
You need to learn
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
-
Decide whether you are reading as series or not. Determine your lookback amounts.
How to do your lookbacks correctly #9 — #14 & #19 (2016) -
Perhaps you should read the manual. What do iLowest/iHighest return?
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up. -
Perhaps you should read the manual, especially the examples.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick/OnCalculate (after the indicator has updated its buffers), you use the handle, shift and count to get the data.
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 (2020)
How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 (2020)
MQL5 for Newbies: Guide to Using Technical Indicators in Expert Advisors - MQL5 Articles (2010)
How to call indicators in MQL5 - MQL5 Articles (2010)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I would like to ask for help to correct the code. Basically I have made a private indicator in Pine Language. I converted that indicator to mql5. But It shows lots of errors. Due to 0 knowledge in Mql5 language, I stucked and requires Help from Experts. Thanks
Code is here and File is attached as well: