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

 
Gilmor:

As you can see this tab also shows supposedly perfect. Loaded it, initiated it. It doesn't have any errors. :(

And so, thank you! Didn't know about the use of this tab.

When trying to set a SellStop pending order there will be an error 130 in the log. Why? - Look at your code.

 
Ffffg Fggg:


Index = minprice + mp ;

what for?

 
Index = minprice + mp ;

I would like theIndex variableto be assigned the value ofminprice and then the new value ofmp.

How it should look like:

Bar 50, difference between the close and low candle's value = -0.12 (mp = minprice)

Bar 49, difference between the close and the minimum value of the candle = -0.17 (Index = minprice + mp) (-0.12 + -0.17)

.....

.....

Bar 1, difference between the close and the minimum value of the candle = -0.07 (Index = minprice + mp) (-6.12 + -0.07)

The result is displayed on the screen.

 
Ffffg Fggg:


you need the total difference between opening and closing, it would be

 summ += open - close; 

why do you needminprice =99999? for what

why do you need the difference of low and close ?

 
Gilmor:

Read, understood what each of the parameters means, set.....

My pending sell is not opening. It doesn't even give out errors.GetLastError()=0! It opens to buy as it should, but ignores to sell. It makes me laugh, what does it want? ))))

Good people, where can I get the necessary knowledge? ))

The SELLSTOP is placed BELOW the current price. So your 50 pips should not be added, but subtracted from the Bid

 
Iurii Tokman:

you need the total difference between opening and closing, it would be

why do you needminprice =99999? for what

why do you need the difference of low and close ?

My apologies and thank you very much. You have answered my question.

 
Ffffg Fggg:

I apologise and thank you very much. You have answered my question.

Please.

 
Maxim Kuznetsov:

The SELLSTOP is placed BELOW the current price. So your 50 pips should not be added, but subtracted from the Bid

:-) Yeah. Epic. In the trade itself, you don't even think about it when you bet. It's automatic. But here it's on the principle, "I didn't even notice the horse." Thank you very much. It's kind of basic, but it doesn't even register in my brain that I should be subtracting, not adding.
 

Hi all. I know it's been explained 100 times already but I still haven't understood what ACCOUNT_MARGIN_FREE means.

I have seen concepts such as:

From the reference:Size of available funds in the account in the currency of the deposit, available to open a position

From internet: This is how many lots I can buy with my available funds


But when checking I get the following picture:

Demo account:

I have $50,000 printf(ACCOUNT_MARGIN_FREE) shows 42

I make a buy and check again but it still shows 42.

If this is the number of lots I can buy with my own money then roughly speaking this volume = 42 and no more.

I was able to buy with volume of 67, 68 would not let me in.

Real account:

30$ shows 42.

I did not make a purchase yet.


What does it mean?

 
killer67:

Hi all. I know it's been explained 100 times already but I still haven't understood what ACCOUNT_MARGIN_FREE means.

I have seen concepts such as:

From the reference:Size of available funds in the account in the currency of the deposit, available to open a position

From internet: This is how many lots I can buy with my available funds


But when checking I get the following picture:

Demo account:

I have $50,000 printf(ACCOUNT_MARGIN_FREE) shows 42

I make a buy and check again but it still shows 42.

If this is the number of lots I can buy with my own money then roughly speaking this volume = 42 and no more.

I was able to buy with volume of 67, 68 would not let me in.

Real account:

30$ shows 42.

I did not make a purchase yet.


What does it mean?


What you are trying to print is wrong. The correct way is this.

printf("ACCOUNT_MARGIN_FREE =  %G",AccountInfoDouble(ACCOUNT_MARGIN_FREE));