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

 
Vinin:

It works quite well.

Hello Vinin.

Analyzed your code. Nice solution to my problem. But still, did my code work for you? Or does "It works" refer to your version of the program?

It is important for me to understand the MQL language.


Question about your version. Why do not you declare the _Bid and _Ask variables at the beginning of the program? Is it allowed in mql4?


Ozero.

 
Vinin:

It works quite well.

Fantastic! Your programme works. But why doesn't mine work like that?
 
Ozero:
Fantastic! Your program works. But why doesn't mine work like that???

What is the first part compared to here?

           if (AktualBid>=AktualAsk+0.010 && PozOtk1==false)

If you corrected the code to get the second value, as you were advised:

                   AktualAsk=MarketInfo( "GBPUSD",MODE_ASK);

then you didn't for the first:

      AktualBid=NormalizeDouble(Bid,Digits); //для цены

And Vinin has it fixed:

   double _Bid=MarketInfo("GBPUSD",MODE_BID); //для цены

That's probably all that's fantastic. But I don't know for sure, check for yourself.

 
Hello, help me to understand the indicator, I want to know which formula is used to calculate the value "Formula 0" as well as the value "Formula 1"
Files:
 
zigga85:
Hello, help me to understand this indicator, I want to know which formula is used to calculate the value of "Formula 0", as well as the value of "Formula 1"
(High+Low+Close)/3 and (High+Low+2*Close)/4
 
Vinin:

It's working quite well.

Dear moderator Vinin!!!!

I have long wanted to thank you for your sincere replies. One of them helped me a long time ago with my transition to real trading. You advised me the right order closing algorithm instead of the one I wrote myself. I still use yours.

The advice in this thread is very nice and helpful.

Once again, thank you very much!

 
Vinin:

It's working quite well.

Good night.


0 errors, one warning: return value of 'OrderClose' should be checked 46 13 is the OrderClose(OrderTicket(),OrderLots(),_Bid,15) line;


Ozero.

 
Ozero:

Good night.


0 errors, one warning: return value of 'OrderClose' should be checked 46 13 is the OrderClose(OrderTicket(),OrderLots(),_Bid,15) line;


Ozero.


ResetLastError();
if(!OrderClose(OrderTicket(),OrderLots(),_Bid,15);) Print("Чё-та не закрылася позиция. Фигня вот такая происходит: "+GetLastError());
 
artmedia70:

Put a ";" behind the bracket.

The programme works, BUT it occasionally fails with error 4108.


Ozero.

 
Ozero:

Pass the ";" behind the bracket.

The program works, BUT it occasionally fails with error 4108.


Ozero.

Open help, see runtime errors, and we see:

4108

ERR_INVALID_TICKET

Incorrect ticket number.

Think and search...

Reason: