[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 511

 
TESKATLIPOKA:


2012.01.16 23:31:02 EURUSD,M15: initialized

as I wrote - initiated

And now put an undo where it does not work and look in the log.

For example, like this:


if (ObjectFind (buy_stop) > 0 ) { //если есть линия buy_stop.
 //if ( ObjectGet (buy_stop, OBJPROP_PRICE1) == Ask )// касание линии
 if (ObjectGet (buy_stop, OBJPROP_PRICE1) <= High[0]) && (ObjectGet (buy_stop, OBJPROP_PRICE1) >= Low[0])) {
  Print("Условие сработало"); 
  OrderSend (Symbol(),OP_BUYSTOP, lots, Ask+Point*order,3, Bid-sl*Point, Bid+tp*Point);// отсылается ордер
  ObjectDelete (buy_stop); // линия удаляется
} else {
 Print("А линию Пушкин будет ставить?");
} else {
 Print("Условие не сработало"); 
}
 

Reshetov:


Now, you put a printout where it doesn't work and look in the log.

Like this:



Thanks for the tip. I'll know more.

but... it wasn't my owtnik. Alas.

It loads and deletes.

And on the chart...

There's a lot of mistakes with the repriming.

 

Hello, could you advise me please?

How can I call a custom indicator from EA or script code? I mean to get the value on a certain bar (like in technical indicators).

Or is it necessary to modify the custom indicator into a function?

 

https://docs.mql4.com/ru/indicators/iCustom is if the custom indicator uses indicator buffers.

If it doesn't, it's better to convert it to a function.

I do not use this function. I think it is better to write everything in the Expert Advisor's code. It works much faster.

 
Zhunko:

https://docs.mql4.com/ru/indicators/iCustom is if the custom indicator uses indicator buffers.

If it doesn't, it's better to convert it to a function.

I do not use this function. I think it is better to write everything in the Expert Advisor's code. It works much faster.


Thank you
 
Can you tell me how to track the closing of an order by a stop loss? If an order has closed at a stop loss, I need to open another one, and there are always a different number of current orders open.
 
sss2019:
Can you please tell me how I can track the closing of orders using a stop loss? If an order has closed at a stop loss, I have to open another one, and there are always a different number of current orders open.

In the cycle of closed orders in the terminal, find the last closed order and if its closing price(OrderClosePrice()) is equal to its StopLoss price(OrderStopLoss()), then the position has been closed at Stop Loss.

But it will not necessarily be in the red (trailing stop).

 
TESKATLIPOKA:

if ((ObjectGet (buy_stop, OBJPROP_PRICE1) <= High[0]) && (ObjectGet (buy_stop, OBJPROP_PRICE1) >= Low[0])

 

Explain how it is possible that the take profit of a buy order is below the opening price?

 
sss2019:

Explain how it is possible that the take profit of a buy order is below the opening price?


What exactly is wrong with that?
Reason: