[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 1042

 

Hello, guys,

Please tell me why the pending order does not work, all parameters are correct, writes wrong stops, if I put a stop, it opens, if I write it down gives out an error 130, but no error in the writing, what is the problem?????? thank you all!!!


int OrdSen_1;
int start()

{
OrdSen_1=OrderSend(Symbol(), OP_BUYSTOP, 0.01, Ask+25, 3, Bid+(25-40)*Point, Ask+(25+40)*Point);

}

 
Aleksandr_8:

Dear guys, can you explain why in this code (closing orders) the order is first selected by SELECT_BY_POS,

and then the same order is SELECT_BY_TICKET ? how does it work?

Print (Symbol(), " START CLOSING BUY LINE");
string symbol = Symbol();int cnt;
for(cnt = OrdersTotal(); cnt >= 0; cnt--){
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderSymbol() == symbol && OrderMagicNumber()==Magicbuy) {
ticketbuy=OrderTicket();OrderSelect(ticketbuy, SELECT_BY_TICKET, MODE_TRADES);lotsbuy2=OrderLots() ;
double bid = MarketInfo(symbol,MODE_BID);
RefreshRates();
OrderClose(ticketbuy,lotsbuy2,bid,3,Magenta);
}

You look through the open and pending orders in order of position number in the list, select the one you are interested in and fetch its ticket

ticketbuy=OrderTicket();

and continue working with the ticket.

 
merkulov.artem:

Hello, guys,

advise why the pending order does not work, all parameters are correct, writes not correct stops, if I put stops, it opens, if I write it down gives out an error 130, but no error in the writing, what is the problem?????? thank you all!!!


int OrdSen_1;
int start()

{
OrdSen_1=OrderSend(Symbol(), OP_BUYSTOP, 0.01, Ask+25, 3, Bid+(25-40)*Point, Ask+(25+40)*Point);

}


Ask+25

StopLoss and TakeProfit prices cannot be too close to the market. The minimum stop distance in pips can be obtained using the MarketInfo() function with the MODE_STOPLEVEL parameter. Error 130 (ERR_INVALID_STOPS) is generated in case of erroneous or non-normalized stops.

When placing a pending order, the opening price cannot be too close to the market. The minimum distance of the pending price from the current market price in points can also be obtained by using the MarketInfo() function with the MODE_STOPLEVEL parameter. If the pending order opens at an incorrect price, error 130 (ERR_INVALID_STOPS) will be generated.

   double bid   =MarketInfo("GBPUSD",MODE_BID); // Запрос значения Bid
   double ask   =MarketInfo("GBPUSD",MODE_ASK); // Запрос значения Ask
   double point =MarketInfo("GBPUSD",MODE_POINT);//Запрос Point
   // Открытие BUY
   OrderSend("GBPUSD",OP_BUY,0.1,ask,3,bid-15*Point,bid+15*Point);
   Alert (GetLastError());                      // Сообщение об ошибке
 
costy_:

Ask+25

StopLoss and TakeProfit cannot be too close to the market. The minimum stop distance in pips can be obtained using the MarketInfo() function with the MODE_STOPLEVEL parameter. Error 130 (ERR_INVALID_STOPS) is generated in case of erroneous or non-normalized stops.

When setting a pending order, the opening price cannot be too close to the market. The minimum distance of the pending price from the current market price in points can also be obtained using the MarketInfo() function with the MODE_STOPLEVEL parameter. If the pending order opens at an incorrect price, error 130 (ERR_INVALID_STOPS) will be generated.


When I open an OP_BUYSTOP . OP_BUYLIMIT, etc. All is normal even when close to the market, but when OP_BUY wrong stops, although all is correct, have tried all combinations and values are all valid, also read on another forum that "there are different demos:-demo, -ndd-demo, -ecn-demo. If 2 or 3, then there is market execution, i.e., first you open an order without any stops, and the following command (OrderModify) sets the stops." I have a regular demo created via MT4 and always gives the same server, so there are no options. how do i check whether i have the right account and what the error is in the end?????

And on the other computer order triggered, if my memory does not change, does it work with you or also error 130.?!!!

Thank you.

 

Hello! I can't understand why the indicator draws arrows before crossing the wands. The indicator is not mine, trying to "read" the code. I think there is a bug. I think there is a bug. If you have time and it's not too much trouble, please comment)))

Files:
 

Who knows how to draw a straight line (a ray from zero) between points so that the sum of the distances from the points to the line on one side equals the sum on the other side?) So that you get a vector.

I used to find the vertical mean and the horizontal mean (of these points) and draw a line through the coordinate, but I think I was told it was wrong

 
merkulov.artem:

When I open an order OP_BUYSTOP . OP_BUYLIMIT, etc. Everything is normal even when the value is close to the market, but when OP_BUY, the stops are not right, although all is correct, I have tried all combinations and values are all valid. I also read on another forum that "there are different demos:-demo, -ndd-demo, -ecn-demo. If the 2nd or 3rd option is a market execution, i.e. first you open an order without any stops, and the following command (OrderModify) sets the stops." I have a regular demo created via MT4 and always gives out one server, so no options. how do i check if i have the right account and what the error is in the end?????

And on the other computer order triggered, if my memory does not change, does it work with you or also error 130.?!!!!

Thanks.


Open the "New Order" window in MT4, if during "market execution" the SL and TP windows are not active, then your assumption is correct, error 130 will appear.
 
Galion:

Hello! I can't understand why the indicator draws arrows before crossing the wands. The indicator is not mine, trying to "read" the code. I think there is a bug. I think there is a bug. Who has time to read it and I don't mind if I do, please comment on it)))

Yes there is a bug. Here is a modification, check it.

Also new version http://forexsystems.ru/indikatory/12345-pomogite-glyuchit-sidus-v-2-a.html

Files:
 
eddy:

Who knows how to draw a straight line (a ray from zero) between points so that the sum of the distances from the points to the line on one side equals the sum on the other side?) So that you get a vector.

I used to find the vertical mean and the horizontal mean (of these points) and draw a line through the coordinate, but I think I was told it was wrong

I don't even know (I want to go back in time, sit in geometry)).
 
from the figure - if there were two points you could simply find the centre of the hypotenuse, but there are many points, and a different number of them on both sides
Reason: