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

 
Dimoncheg >> :

It turns out that I cannot use history to determine if I opened the order by market or by a pending order if their type is the same? So it turns out that if I found orders of the BUY_LIMIT SELL_LIMIT SELL_STOP BUY_STOP type through the history, they are the deleted ones?

If the orders are placed manually, then you can put a mark in the comments. If they are placed by scripts or Expert Advisors, you can also mark them in comments.

 

Hi all,

Probably this question goes here: Why does the Ask function return a number with four decimal places for EURUSD, but in the rates window it is five decimal places? MarketInfo also returns four decimal places.

 
YDzh >> :

Why does the Ask function return four decimal places for EURUSD, but in the rates window it is five decimal places? MarketInfo also returns four decimal places.

If you print or print comments, this should be the reason:

void Print( ...)
...

Data of type double is printed with 4 decimal digits after the point.

To get higher accuracy, you should use DoubleToStr() function.

.

Only Ask is not a function, but a predefined variable.

 
goldtrader писал(а) >>

If you print or comment, this must be the reason:

void Print( ...)
...

Data of double type is printed with 4 decimal digits after the point.

To get more precision you should use DoubleToStr().

.

Except that Ask is not a function, it's a predefined variable.

Got it, thanks :) Another question then:

ticketLong = OrderSend(Symbol(), OP_BUY, lots, Ask, 1000, Ask - stoplossLong * Point, 0, "", 0, 0, Green);

stop loss will trigger when Ask falls below Ask - stoplossLong * Point, right?

ticketShort = OrderSend(Symbol(), OP_SELL, lots, Bid, 1000, Bid + stoplossShort * Point, 0, "", 0, 0, Green);

Stop-loss will be triggered when Ask rises above Bid + stoplossShort * Point or Bid?

 
YDzh >> :

Got it, thanks :) Then another question:

ticketLong = OrderSend(Symbol(), OP_BUY, lots, Ask, 1000, Ask - stoplossLong * Point, 0, "", 0, 0, Green);

stoploss will trigger when Ask falls below Ask - stoplossLong * Point, right?

ticketShort = OrderSend(Symbol(), OP_SELL, lots, Bid, 1000, Bid + stoplossShort * Point, 0, "", 0, 0, Green);

Stop-loss will be triggered when Ask rises above Bid + stoplossShort * Point or Bid?

Everything except the opening price is set at Bid for long positions and Ask for short positions.

 
Reshetov писал(а) >>

For long positions everything except the opening price is set by Bid, for short positions by Ask.

So it would be correct?

ticketShort = OrderSend(Symbol(), OP_SELL, lots, Bid, 1000, Ask + stoplossShort * Point, 0, "", 0, 0, Green);

ticketLong = OrderSend(Symbol(), OP_BUY, lots, Ask, 1000, Bid - stoplossLong * Point, 0, "", 0, 0, Green);

And, accordingly, the short will be closed by a stop loss, when Ask reaches the set value?

 
YDzh >> :

And, accordingly, the short will close at a stop loss when Ask reaches the set value?

Exactly right.

Shorts open at Bid and close at Ask. Longs are vice versa.

If you want to open shorts from the market or by a pending order, Bid price is the only Bid price BEFORE you open.

(Not to mention the SL, TP and Stop Levels of course).

AFTER OPEN there is only Asc.

 
YDzh >> :

So it would be the right thing to do?

ticketShort = OrderSend(Symbol(), OP_SELL, lots, Bid, 1000, Ask + stoplossShort * Point, 0, "", 0, 0, Green);

ticketLong = OrderSend(Symbol(), OP_BUY, lots, Ask, 1000, Bid - stoplossLong * Point, 0, "", 0, 0, Green);

And, accordingly, will the short close at stop loss when Ask reaches the set value?

Not necessarily exceeded, but enough for Ask to touch the set value

 
Reshetov писал(а) >>

Not necessarily exceeded, but quite enough for Ask to touch the set value

Or change the spread upwards.

 
Roger писал(а) >>

Or changed the spread upwards.

And how often does this happen?