[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 106

 
Poseidon:
I'm just a beginner and don't know how to do it. Who wouldn't mind doing it for me?

You should consult a textbook first - it's there, respect yourself first.
 
Roman.:

You should consult a textbook first - it's all there, respect yourself first.
I don't know anything about programming at all.
 
Poseidon:
I don't know anything about programming.

So then there's no need to get involved with questions here, only to prevent people from solving their problems and helping others, go straight to the police, that's all. Besides, learn Russian - it does no harm...
 

Guys in the tester with the model: "at opening prices of a new bar" when executing the order closing fi... I encountered a 138 error - requote - new prices, here is part of the order closing code from the function on the 5 digits - how to deal with it (error #138)... The terminal is standing with A...ray...

Or is it some sort of imitation of real trading? :-)))

if (Tip==0) 
           {
               Price_Cls=NBid;          // Для ордеров Buy  
               Inform(12,Ticket);                  // Сообщение о попытке закр.      
               Ans=OrderClose(Ticket,Lot,Price_Cls,50, Gray); // Закрыть ордер !:)
               //-----------------------------------------------------------   
               if (Ans==false)                     // Не получилось :(        
                   {                                // Поинтересуемся ошибками:     
                       if(Errors(GetLastError())==false)// Если ошибка непреодолимая          
                       return;                       // .. то уходим.  
                    }
                //----------------------------------------------------------
            }


 
alsu:
If you want it to unload completely, you cannot do it with MQL. If you want it to stop responding to the market, then if(Time[0]>=set_time) return(0);


Thank you for your reply. I need an order to be closed at a certain time. I already have a time limit:

if(Hour() > TimeOpen && Hour() < TimeClose)

sistem_2();

return (0);

 
100yan:


Thank you! Reworked the code... TP0==false I put it at the beginning of the program .

The problem remains: The 1st part closes and immediately starts to close the 2nd :-(..., and for the 2nd part the error is 131, understandable - the lot size is different ) But another nuance is that for the 1st part ""Alert ("Closed ",Lot," Lot Buy ",Ticket);"" does not write in the log, i.e. does not reach the Ans==true verification. Why???? Below is a piece of code...

Thanks in advance!

Let me give you the nut and you tell me why the car won't start... :)
 
Roman.:

Guys in the tester with the model: "at opening prices of a new bar" when executing the order closing fi... I encountered a 138 error - requote - new prices, here is part of the order closing code from the function on 5 digits - how to deal with it (error #138)... The terminal is standing with A...ray...

Or is it some kind of imitation of real trading? :-)))



How do I deal with this error? Can you give me a hint... This is not a simulated trade at all... A previously opened trade doesn't close at all - even if the closing condition is always met, it's constantly in the osh log #138, I've checked in visualisation mode by the steps.
 
Can you please suggest a code or a function that would close an order at a 10% drawdown of all funds?
 
todem:
Can you please suggest a code or a function that would close an order at a 10% drawdown of all funds?

Seehere - there was one (or similar) for free before.
 
Roman.:

How do I deal with this error? Can you give me a hint... It's not a simulated trade at all... A previously opened trade doesn't close at all - even if the closing condition is always met, it's constantly in the osh log #138, I've checked in visualisation mode by the steps.
Check the price at which the closing is done, or rather where it's coming from, it's screwed up there.
Reason: