[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 857

 
ERR_REQUOTE 138 - Requested price is out of date or bid and ask are mixed up.
 
FOReignEXchange:
ERR_REQUOTE 138 - Requested price is out of date or bid and ask are mixed up.
I send order at the moment of tick receipt. That's why the slipage is set so that the order is accepted even if the price changes.
 

What I meant to say was that you may have got it mixed up. You should buy at Ask price and sell at Bid price. When opening an order, the opening price may not be correct. If the order to sell has the Ask price, the trade will not open.

Do you know it?

 
FOReignEXchange:

What I meant to say was that you may have got it mixed up. You should buy at Ask price and sell at Bid price. When opening an order, the opening price may not be correct. If the order to sell has the Ask price, the trade will not open.

Do you know it?

Well, I'm not really :) Of course the prices are right. Yes and the mistake would have been different in this case.
 
OrderSend(Symbol(),OP_BUY,Lot,Bid,10,0,0);

I don't know you. An order like this will not open. When I first started writing EAs, I made such a mistake and could not understand why error 138 appeared. I have also tried to increase Slippage but it did not help.

I do not know what else it may be. There are only two variables that can cause this error.

 
how does the indicator code know that a bar has closed on D1 if the indicator is on a lower TF
 

Can you give me a hint?

if (object found), then....

How to implement this condition if the object name should not have a value?

Thank you!

 
IgorM:
How do I know with the indicator code that a bar on D1 has closed, if the indicator is on a lower timeframe?

This is what I would do.

You can insert a condition in the indicator code

if (TimeHour(iTime(NULL,0,0))==0 && TimeMinute(iTime(NULL,0,0)==0))
   {
   }

That is, if these conditions are met, it means that GTM has just started a new day and the daily bar has respectively closed.

It is possible to use ticks, but I do not want to think how it is possible. It would be too Jewish.

 
FOReignEXchange:

This is what I would do.

You can insert a condition in the indicator code

That is, if these conditions are met, it means that GTM has just started a new day and the daily bar has respectively closed.

It is possible to use ticks, but I do not want to think how it is possible. It would be too Jewish.


Thanks, that's what I thought too.

I am looking for a solution without comparison, i.e. by analysis of bar closes/increases on the TF D1 chart

 
IgorM:


Thanks, that's what I was thinking too.

Looking for a solution without comparison, i.e. by analyzing the closing/increasing bars on a D1 TF chart

So let it analyse D1. It just needs to specify what it should analyse. For example, the previous daily bar close price will be iClose(NULL,1440,1) and it does not matter on what TF this analysis is set. You should specify the TF in the function, and that's all.

I do not understand the problem.