Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1057

 
leonerd:

Hello.

Can you tell me how to determine if a position (from the history) has closed on TP? It seems that in MQL4 we read the comment on the presence of "tp". Is it the same in MQL5 or what?

Example ofStop Loss Take Profit implementation in code:

Starting withbuild 1625, a wonderful enumeration ENUM_DEAL_REASON has appeared:

ENUM_DEAL_REASONReason description
......
DEAL_REASON_SLTransaction was triggered by Stop Loss
DEAL_REASON_TPTransaction executed as a result of Take Profit triggering
......

which can be tracked in OnTradeTransaction.

 

I want to "extend" the trend line to the right

I set

ObjectSetInteger(0,name,OBJPROP_TIME,1,TimeCurrent()+_Period*20*60);

But the whole line is to the right for some reason, not only its right point. The price is the same for both points

What is the problem?

 
Roman Sharanov:

I want to "extend" the trend line to the right

I set

But the whole line is to the right for some reason, not only its right point. The price is the same for both points

What is the problem?

It is an error:

_Period

To prevent this from happening, just run the script:



You want seconds in the timeframe - usePeriodSeconds.

Files:
 
Does MT5 still turn a limit order into a market order when the price touches it? Isn't the terminal supposed to be a stock exchange?
 
Vladimir Karputov:

Error:

To prevent this from happening, simply run the script:



You want seconds in the timeframe - usePeriodSeconds.

Thank you!

 
secret:
Does MT5 still turn a limit order into a market order when the price touches it? Isn't the terminal supposed to be a stock exchange?

on the forex or the stock exchange?

 
Roman Sharanov:

on the forex or the stock exchange?

forex
 
secret:
on forex

there are no limits on forex

 
Roman Sharanov:

There are no limits on forex.

Yeah???? 8/

 
Сергей Таболин:

Yes???? 8/

I don't know about the real one, the kitchen one certainly isn't.

Reason: