You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear All
I have an Ea That is working well. But I think that some parameters are not optimized.
All the parameters are putted in arrays:
Array1[0] = "EURUSD";/Currency
Array2[0] = 60;//ime frame
Arra3[0]= 20;//Parameter1
Array[4]=xx;//Parameter 2
What I need is to put thoses value as extern parameter that I can optimize them in back testing.
How to procced. A sample code is highly appreciated.
You could use strings to store you extern parameters.
extern string Par1 = "20,30,40,50";
Then you'll have int arrays.
int _par1[10];
Then you need function to parse the line and store everything in _par1[] variable that will be used in your program.
I copied some code from my indicator:
int line_cnt = 0;
double params[10];
string names[10];
int parse_line(string line){
int len = StringLen(line), i = 0, startPos = 0, par = -1;
if(len < 6) return(0);
string str;
while(i <= len){
if(len == i || StringGetChar(line, i) == sep1){
par++;
str = StringSubstr(line, startPos, i-startPos);
if(par < 6) params[line_cnt][par] = StrToInteger(str);
else if(par == 6) names[line_cnt] = str;
else{
if(StringFind(str, "false") != -1) nPar[line_cnt][par-6] = 0;
else if(StringFind(str, "true") != -1) nPar[line_cnt][par-6] = 1;
else nPar[line_cnt][par-6] = StrToDouble(str);
}
i++;
startPos = i;
}
i++;
}
//nPar[line_cnt][0] = par-6;
}
which can be used this way:
parse_line("Hehe,10,203,40,5.34");
I posted this on another forum, but still have yet to figure this out:
Hi everyone. I'm trying to code a simple MTF stochastic cross indicator, but I'm having a few problems. I used Scorpion's '3 MAs Cross Arrows' indicator as the base and modified it for stochastics (thank you Scorpion!).
Basically I want to have 2 stochastics; one for the current time frame and one for the 4 hour. If the current time frame stochastic turns up and the 4 hour stochastic is turned up, an arrow will be placed. If the current time frame stochastic turns up but the 4 hour stochastic is turned down, an arrow will not be placed.
The indicator I've attatched draws the arrows, however it will draw buy arrows when the 4 hour is turned down, and vice versa. I appreciate any help!
Point ?
Can someone explain what Point means in MT4/MQL?
For example - in FX what would be the point value for EUR/USD? What about USD/JPY? Would it be .0001 for EUR and .01 for JPY?
How about index futures? What would be a point for ES, ER2, YM? .25, .10, 1?
Sorry I am trying to figure out exactly what it means by point because it seems more like it really means pip for FX or tick for futures. There is a big difference between point and tick though.
Thanks.
Hello Coder's Guru,
Just a little message to thank you for your pdf guides.
They are very helpful and well done.
Combine Indicator
Can anyone tell me how to add A 6 LWMA to this Fx Sniper
question about nonlag MA
dear forex-tsd members, I am looking for an alert that will alarm me when 2 non lag ma are going to same direction. What I have setup on my charts are 2 non lag ma made by igorad. Anyways, I have one set up to 9 and the other set to 27. when the trend changes direction the 9 changes color. The same happens with the 27. Anways. how do I get it to when they both change the same color that they alert me with a sound to let me know that the trend is getting stronger? I hope I made myself clear here. Please let me know if I didnt make myself clear enough with my explanation.
chrinist
Tricky Programming Questions
I need some help for an EA I am working on. These are the tough questions. If you know what to do for ANY of these, can you provide an example?
This is for entrys:
1. I know how to look back. How do I flag (or remember) a condition as True for the next n bars while the program looks to see if other conditions become true?
Perhaps use a counter variable, then the question becomes: How do I count forward for n bars from the current (or even an earlier) bar?
(And where in the EA do you put the counter?)
These next questions are for exits:
2. How do I set up a variable that stores the value of the highest (or lowest) High, Low, or Close since entry? It should update every time a higher (lower) value occurs. (See also next question.)
3. How do I set up a variable that stores the value of the highest High (or lowest Low), or Close, of the last n bars since entry?
//this gives you highest/lowest prices on last 10 bars starting with current(last on the graph - zero bar)
double highestPrice = High;
double lowestPrice = Low;
double highestClose = High;
How do you apply this to limit it to the bars since (and including) the entry bar, when you entered a trade less than 10 bars back? After 10 bars you would use the 10 bars.
Note: For High and Low, include the current bar: For Close, use the most recent closed bar.
4. "Bonus Question" If you are Hot today:
How do I close part of an open order, like 30 or 40%?
Thanks!
Hello Coder's Guru,
Just a little message to thank you for your pdf guides.
They are very helpful and well done.Hi clippertm,
Would you please either post the link where I can get these pdf files or the files themselves here.
All the best,
N2