Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 381

 
130.
Wrong stops.
Hmm. Which SL is considered correct?
 
Link_x:
130.
Incorrect stops.
Hmm. What is the correct SL?


For buy below Bid-Point*MarketInfo(Symbol(),MODE_STOP_LEVEL), for sell above Ask+Point*MarketInfo(Symbol(),MODE_STOP_LEVEL).

Do not forget about normalization.

 

Integer what a dose of New Year's altruism ???

Went to bed in the afternoon - now I get up, wipe my eyes, and they still don't believe in these miracles.

 
ALXIMIKS:

Integer what a dose of New Year's altruism ???

Went to bed in the afternoon - now I get up, wipe my eyes, and they still don't believe in these miracles.


I'm sorry, if that's the case.
 
Integer:


For buy below Bid-Point*MarketInfo(Symbol(),MODE_STOP_LEVEL), for sell above Ask+Point*MarketInfo(Symbol(),MODE_STOP_LEVEL).

Do not forget about normalization.

It makes trades now, but does not set SL and TP at all. :)
 
Link_x:
Now the order is executed but does not set SL and TP at all. :)


If we do not enter SL and TP, it means 0. If we did, we would have an order with SL and TP or no order would be opened at all.

The "Wrong stops" error may also occur when your brokerage company does not allow you to open an order with SL and TP. In this case the order is opened without SL and TP and then the order is modified.

 
I can't grasp it.
OK, I've already found an alternative. :)

Let MTS make trades without SL and TP, but close all if potential profit is greater than X.
if(AccountProfit() > 50)
{
OrderClose(Symbol(),0.1,Ask,5);
}
Is it possible to close orders in this way?
By acting in this way, would we have to keep track of the orders?
 
Link_x:
I can't grasp it.
OK, I've already found an alternative. :)

Let MTS make trades without SL and TP, but close all if the potential profit is greater than X.
Is it possible to close orders in this way?
Will we have to keep track of all orders in this way?

We could do that but it is not a good way and we will not be able to separate the work of different EAs from each other. It would be better to count profits by orders.
 
Integer:

You could do that, but it's not a good way of doing it, as it doesn't allow you to separate the work of different EAs from each other. It is better to count profit by orders.

I don't even like it when orders are not closed.
It seems to be my faults, which I cannot find, because of my inexperience.
 
Link_x:

Even so does not close orders, I don't like it.
It seems to be all my faults, which I am not able to find, due to inexperience.

Also, we use GetLastError(), we study what the problem is.
Reason: