[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 128

 
Davit:

Can you please tell me why this function doesn't work and how to make it work?

When selling, the stoploss should be higher than the selling price and the takeprofit should be lower.

OrderClose(nomer_sdelki,koefficent,Bid,3,Red);

The function works correctly, most likely, you put the wrong parameters into it.

 
Roger:

When selling, the stoploss should be higher than the selling price and the takeprofit should be lower.

OrderClose(nomer_sdelki,koefficent,Bid,3,Red);

The function works correctly, you probably put the wrong parameters into it.

It worked hurrah )))) . Thank you!!!
 

I came across this expression in one of the scripts:

bool Direction = Ma[1] > Ma[2] ;

The surprising thing is that everything works and the compiler doesn't complain. Although Ma[1] and Ma[2] are variables of type double, while Direction is of type bool. I even tried logging Direction values - it clearly writes "0" where it should, and "1" where it should. But why is this happening?

 
artmedia70:

I wrote an EA for a similar TS to this one to order. I even tried to make it smarter for the sake of interest. I had to do for it many different functions of my own - to save the deposit when the Expert Advisor started to lose money. After I have removed the expert advisor's custom strategy leaving only my own functions and working according to my own criteria, it turned out to be stable and did not fail in the tester. I do not know how it behaves on the real account; I have sold the Expert Advisor I have completely reworked to the customer as the next version of the ordered EA. Respectively, I don't have rights to publish it. I have only my own developments, which I intend to use for my own purposes... I was about to write mercantile :))))))


Can you post the tests of this EA?
 
FxRoller:

I came across this expression in one of the scripts:

bool Direction = Ma[1] > Ma[2] ;

The surprising thing is that everything works and the compiler doesn't complain. Although Ma[1] and Ma[2] are variables of type double, while Direction is of type bool. I even tried logging Direction values - it clearly writes "0" where it should, and "1" where it should. But why is this happening?


What is there to be surprised about? --> Ma[1] > Ma[2]==X; // logical value.
 
eura:

Can you post the tests of this EA?
I wrote it to order, not for myself. Testing and finding errors for inconsistency with TOR - the prerogative of the customer. My job is to write accurately according to TOR.

When I was finalising it, I tested it, but when I decided to sell it to a customer, I had no use for the test results. Where they are and whether they remained in the bowels of the computer for more than six months - only processor knows ... :)

And it's a thankless task to write a test Expert Advisor using these functions for posting shares ;)
I've learned what I need to know, and that's good enough for me :)

Sorry :)))

 
FxRoller:

I came across this expression in one of the scripts:

bool Direction = Ma[1] > Ma[2] ;

The surprising thing is that everything works and the compiler doesn't complain. Although Ma[1] and Ma[2] are variables of type double, while Direction is of type bool. I even tried logging Direction values - it clearly writes "0" where it should, and "1" where it should. But why do these things happen?

Simply put, there's a logical comparison going on here, which is equal to this:

   if (Ma[1]>Ma[2]) Direction=true;
   else Direction=false;
... and there's absolutely nothing to be surprised about ... ;)
 
artmedia70:

It's a miracle...

There was a message and then there wasn't...

I'll answer: Is this what it takes?

Thank you for your promptness. Still didn't help. There's still a mistake somewhere. We'll keep looking.
 
Please advise how to get the basic knowledge of mql for strategy testing and automated trading. Maybe there are some courses or video lessons?
 
spoiltboy:
Please advise how to get the basic knowledge of mql for strategy testing and automated trading. Maybe there are some courses or video lessons?

you need to google.
Reason: