Questions from a "dummy" - page 177

 
tol64:

In OnTrade() we receive a response from the server. It means that if we check event in OnTrade(), we will already know for sure if there is a position or not. Although we could provide standard options such as DEAL_ENTRY_FULLOUT (complete closing) orDEAL_ENTRY_PARTOUT (partial closing) to make everything perfectly elegant.)))


Good suggestion. For the current moment in real-time, there is no problem, but when analyzing the history we need to summarize the volumes of all deals that created the position, to know when it was finally closed.
 
Valmars:
This is a good suggestion. No problem for the current moment in real time, but when analyzing the history we need to sum the volumes of all deals that formed the position, to know when it was finally closed.
Yes, it is more difficult to analyze the history. True, all of the necessary information can again fit into the comment, but the code then becomes more and more "motley". :)
 
tol64:
Yes, it's harder to analyse the story. True, all the necessary information can again be contained in a comment, but the code then becomes more and more "motley". :)
Through the comment, of course, you can, but only in automated trading with your EA, but when analyzing other people's accounts, and even with manual controlling, you won't succeed. Only through selection through HistorySelectByPosition().
 
Valmars:
Through the comment, of course, you can, but only in the automatic trading of your EA, and it will not work when analyzing the accounts of others and even with manual control. Only through selection through HistorySelectByPosition().

A long, long time ago, I came up with a solution that makes a huge pile of this kind of mess unnecessary.

But it's on the developer side.:(

It consists in adding to the description (structure) of a trade a field describing the resulting open position on a symbol (after a trade has taken place).

Positive values of this field could mean a Buy position, negative - a Sell position. 0 = no position.

--

This can be done even now - and no server will suffer. There is no need to change the server. At all. Everything can be solved inside the terminal.

// This change is even cheaper than paying credits for all forum posts discussing the mess around with calculating positions on history. :)

 
MetaDriver:

... add a field to the description (structure) of the trade describing the resulting open position on the instrument (after the trade has taken place).

Positive values of this field could mean Buy position, negative - Sell position. 0 = no position.

Interesting move! And in combination with new properties DEAL_ENTRY_DECREASE (volume decrease) and DEAL_ENTRY_INCREASE(volume increase) it would be perfect: everyone who needs result volume of a trade - ask us, everyone who needs only trade results (decrease/increase of volume) - ask us!

Have you written to the BOD about your proposal? - Because it's not hard for me to dolt out a nice idea.

MetaDriver:

This can be done even now - and no server will not suffer. You do not need to change the server. At all. Everything can be solved inside the terminal, quite easily.
// This change is even cheaper than paying credits for all forum posts discussing the mess around with position calculation on history.:)

"Credits for all forum posts discussing the hassle around counting positions on history" - are they that expensive? :) Giving them to the altar of change :)

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок - Документация по MQL5
 
Yedelkin:

Interesting move! And in combination with new properties DEAL_ENTRY_DECREASE (volume decrease) and DEAL_ENTRY_INCREASE(volume increase) would be perfect: who needs result volume of a specific trade - you're welcome, who needs only trade result (as "volume decrease/increase") - you're welcome!

About your proposal to the CD wrote? - Because it's not difficult for me to throw in a nice idea.

"Credits for all forum posts discussing the hassle of calculating positions on history" - are they that expensive? :) Giving them up on the altar of change :)

No. They get very stressed out at proposals that change the underlying data structures.

And I really don't like to quarrel with them.

Anyway, I have complexes when it comes to "fundamental" proposals. :)

// I've done a lot of them, and a very small percentage are implemented.

So : have the incentive - go ahead, apply. I hope people will support, the proposal seems to be valuable.

 
MetaDriver:

No. They get very tense about proposals that change the underlying data structures.

And I really don't like to quarrel with them.

Anyway, I have complexes when it comes to "fundamental" proposals. :)

// I've done a lot of them and a very small percentage is implemented.

So: have incentive - go ahead and apply. I hope people will support, the proposal is kind of valuable.

OK, being a radical fundamentalist, I see no reason to back down :) If the proposal to change the underlying data structures is for the good, not the harm, then it is an ideologically sound proposal.
 
Thank you!!!
 

Hi all!

Can you advise me, if I open a trade (Buy or Sell) in the MT5 tester at a certain"point in time".

But at thispoint in time there was no quote on the currency pair (ie there is a gap in the data, ie start of the bar M5 at 00:05, and the next bar after that has already started at 00:25)

And I open a deal in the tester for example at 00:15.

What price the tester sets in the deal from the first bar (Clowes) or from the second (Open).

Or will it refuse to open it at all?

 
I am trying to open five orders. I have been trying to master peculiarities of the fifth terminal. So, I haven't understood it for 40 minutes, I don't see any output in the log! If you can, please take a look at it.
//+------------------------------------------------------------------+
//|                                                     ордерній.mq5 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+

uint resultat=0;
          int i;
void OnTick()
  {
//---
                      for( ;i<5;i++){

 // if( resultat!=10009){
   MqlTick last_tick;
SymbolInfoTick(_Symbol,last_tick);
double Ask=last_tick.ask;
double Bid=last_tick.bid;

   MqlTradeRequest request={0};
   MqlTradeResult result={0};
   
   request.action= TRADE_ACTION_DEAL;
   request.magic =600;
   request.symbol=Symbol();
   request.price=Bid;
   request.deviation=20;
   request.volume=1;
   request.sl=Bid-300*Point();
   request.tp=Bid+300*Point();
   request.type=ORDER_TYPE_BUY;
   OrderSend( request,   result    );    
        
  int Error=GetLastError( ) ; ResetLastError();
  printf("Error %i ",Error);
  
   resultat= result.retcode ;
   printf("resultat %i ",resultat); //}
   Print ( i, PositionsTotal());
   // int PositionTicket= PositionGetInteger(POSITION_IDENTIFIER)
   
                                          }
  

   
  }
//+------------------------------------------------------------------+

 bool  PositionModify( int PositionTicket, double price, double stoploss, double takeprofit, datetime expiration, color arrow_color=CLR_NONE)
      {  MqlTradeRequest request  = {0};

Yes, it opens orders, all is well, but it does not write printers. It says

2012.09.04 17:20:10 Trades '1232639': order #11979593 buy 1.00 / 1.00 EURUSD at 1.25755 done

2012.09.04 17:20:10 Trades '1232639': deal #11107137 buy 1.00 EURUSD at 1.25755 done (based on order #11979592)

2012.09.04 17:20:10 Trades '1232639': instant buy 1.00 EURUSD at 1.25739 sl: 1.25439 tp: 1.26039 (deviation: 20)


2012.09.04 17:20:10 Trades '1232639': instant buy 1.00 EURUSD at 1.25739 sl: 1.25439 tp: 1.26039 (deviation: 20)

2012.09.04 17:20:09 Expert Advisor (EURUSD,M5) loaded successfully