[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 173

 
NayTmeR:

Hello.

Taking apart and modifying the Laguerre indicator, just not working out very well. Please help with the code.

At the end Laguerre started its code.

As I understand it, the indicator line itself is called LRSI.

So I can't assign a counter value to it. For example, when the line crosses 0.45 upwards, LastLag is added by one.

So far, the only problem is assigning a counter value. I can write the whole idea later. Thank you.

the indicator line itself is an array val1[]
 

Hello again everyone.


Still struggling with how to determine if a T/P on a pending order has triggered. I have a filter function, according to OrderCloseTime, but the problem is that the ticket or the Magic Namba also applies to the order itself and its stop order. I.e. we can't reliably understand if the order itself triggered or its stop order? We can only see if the order is in the list or not (T/P has worked or been deleted). If, for example, the order has worked but T/P has not, how should we know?

I am confused.

 
Pyro:

Hello again everyone.

Still struggling with how to determine if the T/P of a pending order has triggered.

If we are talking about TP, then find the order on the history its profit will be >0, if we are talking about a pending order - then remember, in order for the pending order to take a profit - it must become a market order and stop being a pending order: i.e. in the code check the order type OP_BUYSTOP, when the type becomes OP_BUY - so the pending order became a market order
 

Afternoon!

Looking for an EA that automatically puts SL, TP, Trall on a trade + transfer to BU after reaching a certain profit...

Maybe someone will tell me)

Thank you in advance)

 
IgorM:
If we are talking about TP, then find the order on the history its profit will be >0, if we are talking about a pending order - then remember, in order for the pending order to bring profit - it must become a market order and stop being a pending order: i.e. in the code, check the order type OP_BUYSTOP, when it becomes OP_BUY - it means that the pending order became a market
Thank you. Indeed, we have to do it somehow. At first, I did not understand that TP is a property of one order and not an independent order.
 
Pyro:
Grand merci. I really need something like this. At first I did not understand that TP is a property of one order, and not an independent order.


If you look in this thread about 20-30 pages ago I wrote a code where closed orders are analyzed for profit>0 or profit<0

Pavel447:

Looking for an Expert Advisor that automatically places a SL, TP, Trall on a trade + transfer to BU after a certain profit is reached...

https://www.mql5.com/ru/code/mt4/search/?keyword=%D0%B1%D0%B5%D0%B7%D1%83%D0%B1%D1%8B%D1%82%D0%BE%D0%BA
 

Is there any way to avoid this situation ???

Stop and take is correct. Market entry. The Expert Advisor failed to enter long a few seconds after opening a short with the same stop and takeoff parameters.

19:40:21 +ZigZag_Levels CLJ1,M5: Error setting order #130 Market order type = BUY Open Price = 101.53 Stop Loss = 100.77 Take Profit = 102.27
19:40:21 +ZigZag_Levels CLJ1,M5: 4 Order #130 error
 

130 is the wrong stops. So we need to look for an error in the stops. Have you done NormalizeDouble()?


Alternatively, check stoplevel, maybe it has changed during these few seconds (before the news, or something else)?
 
alsu:

130 is the wrong stops. So we need to look for an error in the stops. Have you done NormalizeDouble()?


Another option is to check stoplevel, maybe it has changed over these few seconds (before the news, or something else)?
Well, the point is that the stops are in the middle of nowhere. It has nothing to do with them :(
 
polsvv:
That's the thing, the stops are in the middle of nowhere. They have nothing to do with it :(
NormalizeDouble() in place?
Reason: