Experts: Pairs Trading - page 3

 
Andrey Khatimlianskii:

Operational.

Get rid of it - by increasing memory or changing your approach to the task.

The conclusion is wrong. It can be a lot more than that.

It just stops as soon as it hits the ceiling.

I see. Thank you.
 
Andrey Khatimlianskii:

...

It just stops as soon as it hits the ceiling.

There's just one more thing.

When I restart kamp, disable avj antivirus, start the terminal, it's already 4 MB.

17 is when browsers and other terminals are running....

So I concluded that if I remove something else that loads the RAM, then the test should go.

 

I've got one question sorted out.

What kind of error is this?

How do I fix it?

I understand that it does not support filling mode....

 

Help to revive the robot. Fixed the error - added filling mode. (see the red line in the previous figure).

But trades are not opened in the terminal.

The "Expert Advisors" tab is empty.


 

Figured out the issue - not enough memory on my kappa.

 
Roman Shiredchenko:

Figured out the issue - not enough memory on my kappa.

There is a slip of about 10 in the code. Make it bigger. This is where the owl is waiting for profit.

About filing: in the function for opening positions, put this: request.type_filling=ORDER_FILLING_RETURN; (although instead of ORDER_FILLING_RETURN you can put another filling - see the help).

 
Alexander Pavlov:

There's a slip of about 10 in the code. Put a bigger one. This is where the owl is waiting for profit.

About filing: in the function for opening positions, put this: request.type_filling=ORDER_FILLING_RETURN; (although ORDER_FILLING_RETURN can be replaced by another filling - see the help).

Thank you. The robot worked in the terminal exactly as you suggested.

"(although ORDER_FILLING_RETURN can be replaced by another filling - see the help)." - it didn't work like this - unsurrupted filling mode - there was an error - the lines are commented out.

//int type_filling = ORDER_FILLING_FOK;
int type_filling=ORDER_FILLING_RETURN;

//-----OrderSend:
double MyOrderSend(
   string   symbol,               // symbol
   ENUM_ORDER_TYPE cmd,           // trading operation
   double   volume,               // number of lots
   double   price,                // price
   int      slippage,//=5, // slip.
   double   stoploss,             // stop loss
   double   takeprofit,           // take profit
  // ENUM_ORDER_TYPE_FILLING 
   int type_filling=ORDER_FILLING_RETURN,
  // int type_filling = ORDER_FILLING_FOK, // 
   
   string   comment=NULL,         // comment.
   int      magic=1,              // identifier
   datetime expiration=0,         // order expiry date
   color    arrow_color=clrNONE   // colour
               )  // Money1,ORDER_TYPE_BUY,Lot1,ask,30,bid-StopLoss*point,ask+TakeProfit*point,type_filling,"",0,0,Blue
  {
  //--- prepare the enquiry
   MqlTradeRequest request={0};
   request.action=TRADE_ACTION_DEAL;            // open at the market
   request.symbol=symbol;                       // tool
   request.type=cmd;                            // order type
   request.volume=volume;                       // volume in lots
   request.price=price;                         // price to open
   request.deviation=slippage;                  // slippage
   request.sl=stoploss;                         // Stop Loss
   request.tp=takeprofit;                       // Take Profit
  // request.type_filling=ORDER_FILLING_FOK; // Order type by execution
   request.type_filling=ORDER_FILLING_RETURN;
   request.comment=comment;                     // comment.
   request.magic=magic;                         // ORDER_MAGIC
   request.expiration=expiration;               // order expiry date 
  
 
//--- send a trade order
   MqlTradeResult result={0};
   if (OrderSend(request,result))
   return(result.price);
   else
   return(0);
  }
//-----OrderSend

slip set to 100.

 
 
Hello, the Expert Advisor works on demo, gives profit, will it work on several hedge pairs? Thank you.
Files:
Doble_trade.jpg  59 kb
 
Another question correlation bar on paired symbols is it desirable to set a positive number or also negative? The default is -0.98.