[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 523

 
Maxaxa:

For gloating comedians I will explain why I ask, we are here to write an expert system for fun

If you write in MT4.

not for the money, believe me, but just to solve another applied problem

I am not going to write it on MT4.


PS.
The motivation has to be there. You contradict yourself and do not disclose it.

 
IMHO, you will have enough time to create and then bury more than a dozen expert systems on MT4 with honours.
 
granit77:
IMHO, you will have enough time to create and then bury more than a dozen expert systems on MT4 with honours.

That's what I wanted to hear, thank you. Burying is also a result.


sergeev:

The motivation must be there. You contradict yourself and don't reveal it.


Motivation is always there, you're right. About the disclosure - here, as far as I have noticed, few people disclose their sometimes brilliant ideas to the end, this even applies to elementary things, which is hilarious ))))

The motivation for us is a joint work, if its result will be liquid - well, we will reap the rewards, avidly )))) If not, either we continue, because no solution is found, or prudently withdraw, admitting defeat. It's simple here.

 

Hello. I don't understand why error 130 keeps coming up

int start()
{
//----
OrderSend(Symbol(),OP_BUY,0.05,Ask,2,Bid-30*Point,Bid+50*Point);
int Error=GetLastError();
Alert("Error # ",Error);
//----
return(0)

}

Help me to understand it. At the same time STOPLEVEL=0

 
VladimirR:

Hello. I don't understand why error 130 always occurs

int start()
{
//----
OrderSend(Symbol(),OP_BUY,0.05,Ask,2,Bid-30*Point,Bid+50*Point);
int Error=GetLastError();
Alert("Error # ",Error);
//----
return(0);

}

Help to understand?

https://docs.mql4.com/ru/convert/normalizedouble
 
OrderSend(Symbol(),OP_BUY,0.05,Ask,2,Bid-30*Point,Bid+50*Point);

pay attention to the lot size, set 0.1 instead of 0.05...

and max price deviation - can be made larger, say 5.

 
Maxaxa:

pay attention to the lot size, set 0.1 instead of 0.05...

and max price deviation - can be made larger, say 5.

Corrected. Same thing - wrongstops. And increased the deviation to 5 pips.

 

And what's to be rounded off here?

 
Sorry if I'm probably being obtuse, I'm back with mine. The final part of the EA is not deleting all the ordersYou screenshot and code. I can't fix it. Please, please help me.
//----
   for ( i=OrdersHistoryTotal();i>0;i--){
    OrderSelect(i-1,SELECT_BY_POS,MODE_HISTORY  );
    if( OrderMagicNumber( )==2000 &&OrderSymbol()==Symbol()&&OrderTakeProfit( )==OrderClosePrice(       )&&wremjapomnim<OrderCloseTime( ) ||
   OrderMagicNumber( )==1000 &&OrderSymbol()==Symbol()&&OrderTakeProfit( )==OrderClosePrice(    )&&wremjapomnim<OrderCloseTime( )){
   Alert ("нашли MODE_HISTORY");
 for ( i=OrdersTotal();i>0;i--){
 Alert ("паследний цикл",i);
  OrderSelect(i-1,SELECT_BY_POS );
  if( OrderMagicNumber( )==2000 &&OrderSymbol()==Symbol()|| OrderMagicNumber( )==1000 &&OrderSymbol()==Symbol()){  
  OrderDelete(OrderTicket( )) ; Alert ("OrderDelete-vse",  GetLastError( ) );  OrderClose( OrderTicket( ), OrderLots( ), OrderClosePrice( ) , 0, CLR_NONE);Alert ("OrderClose-vse",  GetLastError( ) ); C=0; }}}}                              
   
   
//----
 // Alert ("wremjapomnim",  wremjapomnim );
 
//----


   return(0);
  }
//+------------------------------------------------------------------+
So, you see, the last loop is not deleted bystop, the condition if is written correctly;OrderSelect(i-1,SELECT_BY_POS ); will be 0 in my prime case, when i is 1.
 
VladimirR:

And what's to be rounded off here?


Opening price, SL and TP