I think mininum of stoploss is "MarketInfo(symbol, MODE_STOPLEVEL)", but I have no idea how can I get the minumum of take profit...
MODE_STOPLEVEL is a distance.It's the minimum distance from price to SL and from price to TP.
Price is either Bid or Ask, which depends upon which direction your trade is going (LONG or SHORT).
So, for ORDER_TYPE_BUY, something like this should work
if ( tp - Ask <= minStopsLevel ) Print("TP too close");
It's the minimum distance from price to SL and from price to TP.
Price is either Bid or Ask, which depends upon which direction your trade is going (LONG or SHORT).
So, for ORDER_TYPE_BUY, something like this should work
Thank you Anthony Garot!
You were a big help!
hello
I have a problem.
If I input a value which is lower than minimum of take-profit, then I would like to show log.
I think mininum of stoploss is "MarketInfo(symbol, MODE_STOPLEVEL)", but I have no idea how can I get the minumum of take profit...
could you help me?
thank you in advance.
You have to get it from market info...
minSLTPdstnc = MarketInfo(Symbol(), MODE_STOPLEVEL);
You have to get it from market info...
I want to get min take profit.
But thank you Ali Sabbaghi :)
As already mentioned by Anthony Garot
It's the minimum distance from price to SL and from price to TP.
don't forget that
MODE_STOPLEVEL
returns the value in points so you will need to multiply it by Point to get the decimal value.
As already mentioned by Anthony Garot
It's the minimum distance from price to SL and from price to TP.
don't forget that
MODE_STOPLEVEL
returns the value in points so you will need to multiply it by Point to get the decimal value.
Ah.. OK Thank you Keith Watford!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hello
I have a problem.
If I input a value which is lower than minimum of take-profit, then I would like to show log.
I think mininum of stoploss is "MarketInfo(symbol, MODE_STOPLEVEL)", but I have no idea how can I get the minumum of take profit...
could you help me?
thank you in advance.