You can use SYMBOL_TRADE_TICKVALUE_*
to get the Infos you need.
As much as I know, this gives you the tick value in your account currency. From there on it's simple math, adjusting the volume to what you need.
If I understand the value given correctly, it referes to the symbols minimum volume.
39863092:
Hello everyone, I am calling you because, as you can see, my current code will close a position when it takes 130 pips, I am trying to change it to close the position when it makes a profit of 1 euro (1 euro for example), the take profit will be set automatically so that a profit of 1 euro is realized taking into account the spread. I try to make sure that the take profit is automatically put according to the profit I ask for (1 euros) and not according to the pips (130 pips). Unfortunately despite several days of testing I can not create this code, I know that among you there are people who can help me.
Thank you.
Hello everyone, I am calling you because, as you can see, my current code will close a position when it takes 130 pips, I am trying to change it to close the position when it makes a profit of 1 euro (1 euro for example), the take profit will be set automatically so that a profit of 1 euro is realized taking into account the spread. I try to make sure that the take profit is automatically put according to the profit I ask for (1 euros) and not according to the pips (130 pips). Unfortunately despite several days of testing I can not create this code, I know that among you there are people who can help me.
Thank you.
Where is your attempt to code it ?
Your code shows 130 points TP not 130 pips.
Alain Verleyen :
Où est votre tentative de codeur ?
Votre code affiche 130 points TP et non 130 pips.
I have error messages I can’t.
39863092:
Hello everyone, I am calling you because, as you can see, my current code will close a position when it takes 130 pips, I am trying to change it to close the position when it makes a profit of 1 euro (1 euro for example), the take profit will be set automatically so that a profit of 1 euro is realized taking into account the spread. I try to make sure that the take profit is automatically put according to the profit I ask for (1 euros) and not according to the pips (130 pips). Unfortunately despite several days of testing I can not create this code, I know that among you there are people who can help me.
Thank you.
Hello everyone, I am calling you because, as you can see, my current code will close a position when it takes 130 pips, I am trying to change it to close the position when it makes a profit of 1 euro (1 euro for example), the take profit will be set automatically so that a profit of 1 euro is realized taking into account the spread. I try to make sure that the take profit is automatically put according to the profit I ask for (1 euros) and not according to the pips (130 pips). Unfortunately despite several days of testing I can not create this code, I know that among you there are people who can help me.
Thank you.
You have the check the PositionProfit value, which is a value on Currency (and not points/pips) and based on the PositionProfit value, you can close it when it reaches the desired profit (1 euro for example)
PositionGetDouble(POSITION_PROFIT)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thank you.