Errors, bugs, questions - page 456

 
_____Life_Line:

This can be implemented in different ways, depending on your task.

Take a look at MQL5 help sections "Chart Periods", "Instrument Information" and pay attention to ChartSetSymbolPeriod() function .

For implementation, you will most likely need to either prescribe a list of TFs and Symbols or get them from the market environment.

 
Urain:

You can implement it in different ways, depending on your task.

Take a look at MQL5 help sections "Chart Periods", "Instrument Information" and pay attention to ChartSetSymbolPeriod() function .

For implementation, you will most likely need to either prescribe a list of TFs and Symbols or get them from the market environment.

Thanks, I've got it. It worked. I put all needed enumerations on switch. The error was in choosing a correct string type for the pair and ENUM_TIMEFRAMES for the period.
 

Hi all, there is a very unpleasant nuance when closing open positions,

Profit get for example +150$ and close all: BUT on the chart saw such a picture:

decided to make a small addition before we close all positions on the different symbols in the code it is so:

    double bal = AccountInfoDouble(ACCOUNT_BALANCE);
    double eqv = AccountInfoDouble(ACCOUNT_EQUITY);
    if (bal < eqv && (tral == false && GetProfit()>= PP))
     {

i.e. when the profit on all pairs is more than specified in parameters, and equity is more than balance, then we close

But after these changes the situation has not changed, now we have the same nuances only in a different place.


I have the only explanation for this: we have calculated a text profit that is higher than the one we set in +.

and when we started to close the prices have already changed i.e.A couple of ticks in

of ticks in the tester passed and we were already in the red while everything was closing (2 pairs of instruments

EURUSD .. GBPUSD)

So ?

 
Im_hungry:

Hi all, there is a very unpleasant nuance when closing open positions,

.............

So ??

Are there any stops?
 
MetaDriver:
Got any feet?
"Well where do they get their feet in Italy, I've seen their Italy on a map, boot on boot"(s)almost Armoured) :o)
 
MetaDriver:
Stops are there?

No only trawl (what's below on each tick), now tried the following code:

    double bal = AccountInfoDouble(ACCOUNT_BALANCE);
    double eqv = AccountInfoDouble(ACCOUNT_EQUITY);
    if (bal < eqv && (tral == false && AccountInfoDouble(ACCOUNT_PROFIT)>= PP))

PP - profit in parameters, and still the same misses, couple of ticks and we're all at a loss or else...?

It opens by arbitrage on 2 pairs (EURUSD ... GBPUSD) and when we reach the desired profit

We close.

 

I've made sure that the extra lines don't interfere with closing the poses quickly,

less skips, but I'm more and more inclined to think it's because of the slowness of the computer,

I've got enough RAM, but I've got a full CPU?

 

Please advise on how to interpret the status of SYMBOL_TRADE_MODE.

Can I send orders to change stop levels in the SYMBOL_TRADE_MODE_CLOSEONLY mode?

 
Im_hungry:

No only trawl (what's below on each tick), now tried the following code:

PP - profit in parameters, and still the same misses, couple of ticks and we're all at a loss or else...?

We open arbitrage on 2 pairs (EURUSD ... GBPUSD) and after achieving the required total profit

We close.

The provided code is not enough. There is an error outside of it.
 
MetaDriver:
The code provided is not sufficient. The error is outside of it.

after that (

bal < eqv && (tral == false && AccountInfoDouble(ACCOUNT_PROFIT)>= PP && sum>=PP)

) the poses are immediately closed with this code which was taken from this site

   MqlTradeRequest mrequest;                           
   MqlTradeResult mresult;                             
   if(PositionSelect(Symbol_1)==true)
     {
       mrequest.action = TRADE_ACTION_DEAL;              
       if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY) mrequest.price = SymbolInfoDouble(Symbol_1,SYMBOL_BID);    
       if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL) mrequest.price = SymbolInfoDouble(Symbol_1,SYMBOL_ASK);
       mrequest.symbol = Symbol_1;                         
       mrequest.volume = PositionGetDouble(POSITION_VOLUME);                          
       mrequest.magic = PositionGetInteger(POSITION_MAGIC); ;                           
       if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY) mrequest.type= ORDER_TYPE_SELL;                    
       if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL) mrequest.type= ORDER_TYPE_BUY;
       mrequest.type_filling = ORDER_FILLING_AON;         
       mrequest.deviation=Prosk;                          
       OrderSend(mrequest,mresult);

I do not have any errors in 2 currency pairs. I will try to analyze what is wrong but the fact is that I got different results on different computers with different interfaces and almost no skips at closing

Reason: