Errors, bugs, questions - page 769

 
sergeev:

Installed it at home - brought it on a flash drive.

Tested! admin is happy. no beers asked for.


Will not update...
 
Alex5757000:
There will be no updates...
you can update from home, bringing only verified builds.
 
Alex5757000:
Will not update...

repeat the algorithm.

Updated at home - brought it on a flash drive.

Checked! Admin is doubly happy.
 
sergeev:

repeat the algorithm

Updated at home - brought it on a flash drive.

Checked it out! Admin is doubly happy.

Yes, we did. it's working fine. Thank you.
 

Looks like the fourth lung at 503 again... :-(

Now - it's working...

 
R0MAN:

Looks like the fourth lung at 503 again... :-(

Now - it's working...

We were the ones who upgraded it, it stopped for half a minute.
 

I'm racking my brains... the stop just won't set... and a lot of errors. this is what's left of the experiment, and it won't work anymore

void OnTick(){ if(PositionsTotal()<1){OPEN();}}

bool OPEN(){
             MqlTradeRequest request;
             MqlTradeResult result;
             

             request.symbol       = _Symbol;
             request.action       = TRADE_ACTION_DEAL;
             request.type_filling = ORDER_FILLING_FOK;
             request.deviation    = 100;
             request.volume       = NormalizeDouble(2,2);
             request.type         = ORDER_TYPE_BUY;
             request.price        = NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK),_Digits);
             request.tp           = NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK) + 500*_Point,_Digits);
             request.sl           = NormalizeDouble(SymbolInfoDouble(_Symbol,SYMBOL_ASK) - 500*_Point,_Digits);

             OrderSend(request,result);     
                        
             if(result.retcode==10009 || result.retcode==10008)  Print("Succsesful open");
             else                                               Print("Error open: ",DoubleToString(GetLastError(),0),"  response code: ",result.retcode);
    
   return(true);}

If you do this, there are no errors, but the stop-loss is still not set

MqlTradeRequest request={0};MqlTradeResult result={0};
 
maryan.dirtyn:

I'm racking my brains... the stop just won't set... and a lot of errors. this is what's left of the experiment, and it won't work anymore

If you do this, there are no errors, but the stop-loss is still not set

There is a magic ZeroMemory() function. Apply it to initialize or reuse.

And about stops, see if your broker doesn't support setting stops at once (e.g. at exchange execution), then they can be added separately.

 

it doesn't work on a standard demo from metaquotes... if the demo doesn't support setting stops right away... is mt5 made specifically to drain the depo?)

a simple function and it doesn't work... what else could it be about?

The mt5 has the same effect as the brokers that I've always thought it would be better to place stops with the help of mt5.

so i'd rather not disturb those who tell me to use standard libraries. i like to know what my EA does than hope it won't flatten out later.

Документация по MQL5: Стандартная библиотека
Документация по MQL5: Стандартная библиотека
  • www.mql5.com
Стандартная библиотека - Документация по MQL5
 
maryan.dirtyn:

It doesn't work on a standard demo from metaquotes... if the demo doesn't support setting stops right away... is mt5 made specifically to drain the depo?)

Use standard trade classes, they will hide all the complexity of filling orders and simplify the code. For example, CTrade gives very simple trading methods.

Since you have questions even on the simple filling of trade order fields, it's best to look in the source code of the corresponding trade classes and find a solution there. Use them specifically - they simplify programming and give full control over errors.

Reason: