[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 43

 
sting-igor:
Is there some kind of block against them meddling in your affairs?
Of course there is! It's in your head. You have to block them in there. Don't let them go anywhere!
 
If I open a position like this:
if (OrderSend(Symbol(),OP_SELL,...)==true)
{ Print ("ok"); return(0); }
and the dc won't open a trade for some reason, will the EA send a trade to the dc on every tick? I just don't want to run into error 8 (Too frequent requests). Or is it more reasonable without checking for true, but to see what the error is and put the EA to sleep?
 

ShamanK, thank you! Everything works. Very helpful.


Can you also comment on the line


if (symbols1[i2]==OneSymbol) {textNew = textNew + symbols2[ i2 ] ; i2=ArraySize(symbols1) ; }

If we find a single character in an array, the new text equals...

What role does a semicolon play?

 

Hello.

I'm not familiar with MQL yet, but I want to write an EA based on the CCFp cluster indicator. It works with eight currencies, I need only EURUSD or more precisely only EUR. I am trying to take values from indicator with the following way:

for (cnt=0;cnt<3;cnt++)

{
ccfp[1,1]=iCustom(NULL,0, "CCFp",1,0,3,5,1,0); //ccfp [symbol number (counting from zero 1 is EUR), buffer cell number] 1,0,3,5 indicator parameters
ccfp_old[1,1]=iCustom(NULL,0,"CCFp",1,0,3,5,1,5);//Previous value
Print("Ccfpnow:",ccfp[1,1]);
Print("Ccfpold:",ccfp_old[1,1]);

}

I.e., I want to get values that are rendered by indicator by eur movement.

The problem is that the terminal indicator shows values of 0.0001, but my Expert Advisor shows 0.0093 or -0.0025 and previous value 0.0013. I tried to write a specific symbol, timeframe, line number, but still some kind of nonsense.

Question: how do I get the correct values (the same as in the terminal) of the indicator for a particular currency?

Files:
ccfp.mq4  19 kb
 


alsu
:

134 - no money, 4051 - shit function parameters transferred.

As for the point - check that variable magick is assigned only 1 time, preferably in function init(), otherwise each order will have its own magick and the result will be something like you describe.


Got it, thanks!

"4051 - shit parameters passed to a function" - can you be a little more specific?)

 
Comrades how do I get the history of M5,M15 for five months, etc.?))) I have an Expert Advisor that downloads the data in Excel, but the five-minute data only for 1 day download ...
 
orb:
Comrades how do I get the history of M5,M15 for five months, etc.?))) I have an Expert Advisor that downloads the data in Excel, but the five-minute data only for 1 day download ...

It's M15 instead of M5 and five months instead of 1 day...)

_ _ _ _ _ _ _ _ _ _ _ _

people please advise the code =>> how to execute the condition only once at the Open candle?

i.e. the condition should be fulfilled at the opening of a new candle.

 
w_ersoc:

You have to put M15 instead of M5 and five months instead of 1 day...)

_ _ _ _ _ _ _ _ _ _ _ _

please advise code =>> how to execute the condition only once when an open candle is formed?

That is, when a new candle is opened the condition should be fulfilled.

got it, newly minted expert)))

the answer to your question

at the start you write

if Volume[0]<2

{

your algorithm

}

 
Fox_RM:
Tell me why you have the iMAOnArray function in a separate loop?

It doesn't work any other way
 
Lians:

ShamanK, thank you! Everything works. Very helpful.


Can you also comment on the line


if (symbols1[i2]==OneSymbol) {textNew = textNew + symbols2[ i2 ] ; i2=ArraySize(symbols1) ; }

If we find a single character in an array, the new text equals...

What role does a semicolon play?

If you find a single character in the array, it's the character you're adding to the text.

example:

string txt1 = "123";

string txt2 = "456 ";

string txt3 =txt1 +txt2 ;

as a result, we get "123456" in txt3 variable

The semicolon is a programming language syntax indicating the end of a line of code.