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

 
ikatsko:
How to Create a Comment on an Order in MQL4?

When an order is sent, the comment is one of its parameters, but optional, and it is often omitted...

https://docs.mql4.com/ru/trading/OrderSend

 
splxgf:

When an order is sent, the comment is one of its parameters, but optional, and it is often omitted...

https://docs.mql4.com/ru/trading/OrderSend

What if the order is already open?

 
ikatsko:

What if an order is already open?


As you can see this option is not available in the terminal itself when manually modifying an order... The comment cannot be changed in an order that is already open.
 
Thank you!
 
granit77:

Carried over.

Kurilin 05.09.2011 05:30


Hello, i've started to write an EA in MQL4, i haven't done it before. If i'm not sure how to use this function, i'm not sure i'm sure i'll be able to use it correctly, but i'm sure i'll still see the bottom line of the Bollinger Bands indicator and the Ask line, for example. I am very thankful for the help.

double Bands_Low0 =iBands(Symbol(),Period(),20,2,0,PRICE_CLOSE,MODE_LOWER,0); // Нижняя  линия на нулевом баре
double Bands_Low1 =iBands(Symbol(),Period(),20,2,0,PRICE_CLOSE,MODE_LOWER,1); // Нижняя  линия на первом  баре
double Bands_Low2 =iBands(Symbol(),Period(),20,2,0,PRICE_CLOSE,MODE_LOWER,2); // Нижняя  линия на втором  баре
double Bands_High0=iBands(Symbol(),Period(),20,2,0,PRICE_CLOSE,MODE_UPPER,0); // Верхняя линия на нулевом баре
double Bands_High1=iBands(Symbol(),Period(),20,2,0,PRICE_CLOSE,MODE_UPPER,1); // Верхняя линия на первом  баре
double Bands_High2=iBands(Symbol(),Period(),20,2,0,PRICE_CLOSE,MODE_UPPER,2); // Верхняя линия на втором  баре
You then compare the Ask price with the variable values on the desired bar. Although, when the price and the variable values are explicitly compared, they will not always be really equal when they are apparently equal. Therefore, we should check bollinger lines crossing by price both from down to up and from up to down. To do this, we should compare the High or Low values (depending on the direction of the crossing being checked) of the previous candle with the value of the variable corresponding to the bar of the checked candle and the values of the first candle (the zero one will give a lot of false signals)
 

Please advise how to make an EA open an order with zero TP and SL and then set TP and SL, it is necessary for Market Execution.


avatar
1
papa-di 05.09.2011 19:08
Please tell me how to open an order with zero TP and SL and then set TP and SL for Market Execution.
 
sergeev:

Please advise how to make an EA open an order with zero TP and SL and then set TP and SL, it is necessary for Market Execution.


1
papa-di 05.09.2011 19:08
Please advise how to open an order with zero TP and SL and then set TP and SL which is necessary for Market Execution.

You can open an order with the first line of code and modify it with the second one :))))))

And if you do it right, then:

1. Before opening, check position parameters for valid parameters

2. open a position

3. Make sure the position is open

3.1 If not, deal with the error that occurred (there may be many)

3.2 After the error is correctly processed, there are several options. One of them is the inability to open a position - exit from the function, informing the Expert Advisor about that for its correct further work

3.3. after the error is handled correctly and the parameters are corrected, provided the order is finally opened

4. Check the stop and take position parameters for valid StopLevel limitations of your brokerage company, correct them if needed

5. Modify the open position

6. Check whether the modification was successful

7. etc., etc. .....

Who has it easy now ??? :))))))))))))))))

 
artmedia70:

First line of code to open an order, ........ :))))))

Who has it easy now? :))))))))))))))))


Is it possible to write the code in such a way, that the Expert Advisor would stack the money in the nightstand in even rows?

Maybe, there is a ready function?

)))

 

Could you please tell me how to modify my EA to trade on Market Execution so that it opens with zero Take Profit and Stop Loss and then sets Stop Loss and Take Profit?

Please write a typical code. Thank you in advance.

 
Please advise how to modify EA to make it work on Market Execution, so that the order was opened with zero stop and take and then the order was modified, please give a typical code. Thank you in advance. <br / translate="no">


You got your answer above. Do not duplicate your posts and topics