Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 43

 
Movlat Baghiyev:

Afternoon ...

if (OrderType()==OP_SELL) CloseOpBuySell("BUY");

if (OrderType()==OP_BUY) CloseOpBuySell("SELL");

here is the condition I need to close a Sell position when opening a Buy position and vice versa.

I am interested just in the left side OrderType()==OP_SELL

the right hand side works when any signal is pushed there

Question: "Will this close work?

There is not enough code to understand it. If the CloseOpBuySell function and order selection conditions are correct, yes
 
Please advise how to prescribe the following: when a pending order triggers, close an open order in the Expert Advisor.
 

Hello.

Can I ask for some help?

How do I know that the loss from the beginning of the day on closed positions was 10%?

 
Artyom Trishkin:

...... the first bar of which TF you want data...


The Expert Advisor is on M 5 and I want to get the value of the indicator with a timeframe of one hour.

 
mila.com:

The EA is on M 5 and I want to get the value of the indicator with a p.f. of one hour.

Once again, do you want to know what was on the last hour on the indicator on the H1, or do you want to know what is happening on the indicator on the H1 at this moment in time?
 

I don't want to sound intrusive in this society, but no one has ever explained to me where 0 comes from in the calculations?

post 413

possible loss of data due to type conversion count.mq4 231 12

possible loss of data due to type conversion count.mq4 246 12

 
trader781:

I don't want to sound intrusive in this society, but no one has ever explained to me where the 0 in calculations comes from?

post 413

possible loss of data due to type conversion count.mq4 231 12

possible loss of data due to type conversion count.mq4 246 12

Possible loss of data due to type conversion

It is not critical, but it needs to be fixed.

 
trader781:

I don't want to sound intrusive in this society, but no one has ever explained to me where 0 comes from in the calculations?

post 413

possible loss of data due to type conversion count.mq4 231 12

possible loss of data due to type conversion count.mq4 246 12

Well, maybe someone will download the code and study it. But it would be better to show it with SRC - you can see it instantly and don't need to download, open, look, then delete...
 
Artyom Trishkin:
But it would be better to show it through the SRC
How's that?
 
trader781:
How do you do that?

Spit it out, do you see the SPC button