Errors, bugs, questions - page 687

 
hrenfx:

00:02 - {NAN, 1.2310, 1.2290, 1.2305} (OHLC);

Where is the flaw?

The flaw here is that you have to constantly prescribe a functional to determine the missing bar parameters. The need for the example you cite is a special case.

hrenfx:

00:00 - {NAN, NAN, NAN, NAN} (OHLC);

Where is the flaw?

I don't understand this construction, because Expert Advisors work within a tick and most Expert Advisors don't care about the time of a new tick arrival.

Perhaps this design is used to simplify multicurrency synchronization, but the absence of this design can be successfully replaced with a function for searching for the last bar that occurred.

The presence of this structure in the history can complicate the analysis in most cases, because we must constantly identify the absence of the missing parameters of a bar.

p.s. Working with the constructions you cited seriously complicates the processing. It is much easier to find the last bar that took place.

 

abolk:

1. Do you constantly start building the bar at 'supply prices'?

2. What are those prices?

3. how do we know them?

1. And rightly so. You have not yet proved the incorrectness of such a scheme. All you've done is point out that "there are options".

2, 3. The bid prices are broadcast by the broker. They are called Bid and Ask. And they are the actual prices until they are replaced by others. The deals are not a criterion at all, in Forex only the price changes are broadcasted, and the deals at the fixed prices can be as many as you want - until the volumes of the nearest Limits in the market are exhausted whose prices are the broker's current offer. Current Bid and Ask. Got it? If anything, ask the documentation or Yandex and Google.

 
abolk:
The flaw here is that you have to constantly prescribe a function to determine the missing parameters of the bar. The need for the example you cite is a special case.

This is nothing compared to the mis-synchronisation, however, to remove this stressful flaw as well, an alternative offer was sounded:

Hrenfx:

In this case, if there is no offer price at the time of the minute (opening of the trading session), no bar is formed, ...

For the same example:

  1. Opening of trading session 00:00:00.
  2. The first price appears at 00:02:34 - 1.2301. Then within a minute the price changes in the range of 1.2290 - 1.2310. And at the end of 00:02 minutes it becomes 1.2305.

It would be as follows:

  • 00:00 and 00:01 bars are absent.
  • 00:02 - {1.2301, 1.2310, 1.2290, 1.2305} (OHLC);

What other flaws are there?

P.S. The variant with NAN is the most logically correct. The compromise variant allows to get rid of the conditional if operator on each bar but it will require synchronization of the multi-fee bars at the moment of opening/closing of the trading session.

 
MetaDriver:

Got it? If anything, ask the documentation or Yandex and Google.

I don't get it. Why the constant arrogant tone?

Some kind of unfounded mania of omniscience, omniscience and omniscience.

I'm going to take a leave of absence.

 
abolk:
I can't say anything about the presence/absence of "failed" bars - it's not critical for me. Also unknown are the implementation problems. Maybe they are significant and the current solution is a compromise for now. If it is so important and it is not present in the terminal, the "drawing" of "failed" bars can be implemented manually.
Andriy, I have a favor to ask you - please do not interfere in topics that are not critical for you. Such an interference is like an attempt to "wise up" on an unimportant subject - it is safe and gives the opportunity to take a status "point" from those present. If you manage to come up with a good idea. You have not thought about the current field repeatedly, so you cannot say anything sensible in this case. Intelligent - means useful to those for whom it is critical. I'm not giving advice and answers on the subject of "graph-building" in the terminal. You think I have no thoughts about it? Yes, I do. I just understand that I am "out of the loop", because I don't use it in my daily practice. No offence, Andrew, just a request. You have the right to publish your opinion (you have already done so), but it is simply stupid of you to start and continue this argument. You are simply "out of touch".
 
abolk:

I don't get it. Why the constant arrogant tone?

Some kind of unfounded mania of omniscience, omniscience and omniscience.

I think I'll retire to the garden.

It's not arrogant, it's mocking in this case, openly mocking-mockery, not without that.

Strangely enough, I have no remorse, for you are desperately stupid and on the verge of pretending to be.

 
MetaDriver:
Andrew, I have a request to you - do not meddle, please, in topics that are not critical for you. This kind of meddling looks like an attempt to "wise up" on an unimportant subject - safe and allows the occasionally status "point" to take a shit from those present. If you manage to come up with a good idea. You have not thought about the current field repeatedly, so you cannot say anything sensible in this case. Intelligent - means useful to those for whom it is critical. I'm not giving advice and answers on the subject of "graph-building" in the terminal. I just understand that I am not in the loop, because I don't use it in my daily practice. No offence, Andrew, but just a request. You have the right to publish your opinion (you have already done so), but it is simply stupid of you to start and continue this argument. You are simply "out of touch".

Well, as for whether or not to express my opinion, that is for me to decide. Also, let me not ask your permission to speak out on this or that topic, whether I am "on" or "off". If you have moderator rights, you can delete my posts and leave your own. But since you don't have moderator rights, but only a pointing finger, then ... ...you can use it for your own personal "correct understanding of the subject".

 
Give it up - no change is expected on this front any time soon.
 

Why does every EA of mine flub by deleting the orders?An order is placed and immediately deleted.

Here is an example: 2011.01.24 М1, time of placing orders 2:00. DC metaquotes-demo.

MqlTradeResult resultU,resultD;MqlTradeRequest request;MqlTick latest_price;MqlDateTime ctime;
int OnInit()
{ request.symbol = _Symbol; // symbol
request.volume = 0.1; // number of lots to trade
request.magic = 52; // Magic Number
request.type_filling = ORDER_FILLING_AON; // order execution type - all or nothing
request.deviation=40; // slippage from the current price
request.comment="TL";
request.type_time=ORDER_TIME_GTC;
request.type_filling=ORDER_FILLING_RETURN;
return(0);
}
void OnTick()
{
if(OrderSelect(resultD.order) || OrderSelect(resultU.order) )
{ OrderSelect(resultU.order);
if(OrderGetDouble(ORDER_PRICE_OPEN)!=1.36207)
{ Print("bbb ",OrderGetDouble(ORDER_PRICE_OPEN);
request.action = TRADE_ACTION_REMOVE; // immediate execution
request.order=resultU.order;
OrderSend(request,resultU);
request.order=resultD.order;
OrderSend(request,resultD);

return;
}
OrderSelect(resultD.order);
if(OrderGetDouble(ORDER_PRICE_OPEN)!=1.35855)
{Print("sss ",OrderGetDouble(ORDER_PRICE_OPEN));
request.action = TRADE_ACTION_REMOVE; // immediate execution
request.order=resultU.order;
OrderSend(request,resultU);
request.order=resultD.order;
OrderSend(request,resultD);
return;
}
//nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
//nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
}else//new order
{ TimeCurrent(ctime);
if(ctime.hour==2){
request.action = TRADE_ACTION_PENDING;
request.type=ORDER_TYPE_BUY_STOP;
request.price=1.36207;
request.sl=1.36031;
request.tp=0;
OrderSend(request,resultU);

request.type=ORDER_TYPE_SELL_STOP;
request.price=1.35855;
request.sl=1.36031;
request.tp=1.34484;
OrderSend(request,resultD);
}
}
}

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций - Документация по MQL5
 
I have been struggling with this bug in various EAs for half a year now((((((
Reason: