- Create a profit function
- Questions from a "dummy"
- strategy tester input help
-
Resize your array. Perhaps you should read the manual. ArrayResize - Array Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up. -
Populate your array. Perhaps you should read the manual. Loop Operator for - Operators - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
-
Resize your array. Perhaps you should read the manual. ArrayResize - Array Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up. -
Populate your array. Perhaps you should read the manual. Loop Operator for - Operators - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
Okay, I thought id be able to use a for loop to do it, but I'm struggling to understand populating a series using a for loop.
Say I had an EMA:
double ema[]; int ema_def = iMA(Symbol(),Period(),50,0,MODE_EMA,PRICE_CLOSE); ArraySetAsSeries(ema,true); CopyBuffer(ema_def,0,0,10,ema);
And then I want to plot the the ema on my small chart for X periods depending on the input:
input int periods = 5;
I'd want my x and y co-ordinate arrays to automatically resize using these values:
double x[] = {1,2,3,4,5}; double y[] = {ema[4], ema[3], ema[2], ema[1], ema[0]};
Could I use a combination of ArrayResize() and a for loop to do this?
Because if I wanted to plot 150 ema values, it would end up being a pain to do manually!
Thankyou in advance!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use