Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 111

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
Thank you very much! I needed it to compare candle characteristics (more, less, etc.) I screwed it on - it works. Only can not understand how it compares the data type string? Or double to string does not translate number to string? :-D
PS. It doesn't work in indicator - only in script... When I call High[i] - I get only 4 decimal places in it.
I'm writing:
Alert ("doubletostr High = ", DoubleToStr(High[1],5));
if (DoubleToStr(High[2],5)>(DoubleToStr(High[3],5))
{
Alert ("More");
}
if (DoubleToStr(High[2],5)<(DoubleToStr(High[3],5))
{
Alert ("Smaller");
}
Works, it writes the result with five digits, over/under counts. The problem is that in the indicator the string array doesn't show up on the chart. Therefore...
...writing:
Alert ("Normalized Double High = ", NormalizeDouble(High[1],5));
Doesn't work - the result is > 1,1234
I do not understand the developers - why did they have to complicate things so much? Why, if it shows so many digits on the chart, it won't scratch the called function with five digits? Maybe there is a simple solution?
It gets even more interesting:
translate
Alert ("iFractals doubletostr= ", DoubleToStr(iFractals(0,0,MODE_UPPER,2),Digits));
Writes: 1,32169 - OK.
Convert back to a numeric value using StrToDouble:
Alert ("iFractals StrToDoubledoubletostr= ", StrToDouble(DoubleToStr(iFractals(0,0,MODE_UPPER,2),Digits));
Result: 1.3217
There should be a meme with Jackie Chan where he doesn't understand the chip).
And what does Alert actually output?
It says 0.01 but it's actually 0...0100.
It gets even more interesting:
translate
Alert ("iFractals doubletostr= ", DoubleToStr(iFractals(0,0,MODE_UPPER,2),Digits));
Writes: 1,32169 - OK.
Convert back to a numeric value using StrToDouble:
Alert ("iFractals StrToDoubledoubletostr= ", StrToDouble(DoubleToStr(iFractals(0,0,MODE_UPPER,2),Digits));
Result: 1.3217
There should be a meme with Jackie Chan where he misunderstands the chip).
DoubleToStr() is used to output messages with the accuracy you want. Standard Print(), Alert(), etc., print in 4 digits.
When you want to see a number with the accuracy you want, use DoubleToStr() then, not in calculations.
You don't need to translate anything back and forth ... ;)
It says 0.01 But the actual value is 0...0100.
Output then 100 * point = 100 * 0.00001 = 0.001pp (if for five digits)
The value of lBUY has been changed above. Therefore, as I see it, the condition:
Will not be met. And therefore the value of lBUY will remain the same.
The j variable must be explicitly initialised at the beginning of the function with a negative value. Try it. I haven't looked any further yet.
Hmm. So far the same thing. Here we have:
DoubleToStr() is used to output messages with the accuracy you want. Standard Print(), Alert(), etc. will print 4 digits.
When you want to see a number with the accuracy you want, that's when you use DoubleToStr(), not in calculations.
You don't need to translate anything back and forth ... ;)
It's understandable... now...) But the whole point is that I need to somehow dig out a fifth digit for calculations(
If DoubleToStr() is not good for it, then this language has no such feature? Didn't the developers foresee this?
Hmm. So far, so good. Here we are:
It's understandable... now...) But the whole point is that I need to somehow dig out a fifth digit for calculations(
If DoubleToStr() is not good for it, then this language has no such feature? Didn't the developers foresee this?
Gentlemen programmers! Please advise how to combine an EA with an indicator?
For example, I took a simple bot mo_bidir.mq4 that trades using its own algorithm and I want it to continue opening trades using its own algorithm but after the signal of 3 МА.
For example on a signal - Three Moving Averages:
FastEMA>MediumEMA>SlowEMA (trend up) - bot buys
FastEMA<MediumEMA<SlowEMA (trend down) - bot sells
Inp_Signal_ThreeEMA_FastPeriod = 8;
Inp_Signal_ThreeEMA_MediumPeriod = 38;
Inp_Signal_ThreeEMA_SlowPeriod = 48;
What I need is for the Expert Advisor to continue trading on 5 minutes and the indicator to give signals from the daily or 4hour timeframe, and I want to be able to change timeframes in the bot settings.