# how I set minimum value of take profit?

90

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?

3297

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...

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");`
90

Anthony Garot:

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!

1453
sabbaghi89
Par duck:

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?

You have to get it from market info...

`minSLTPdstnc = MarketInfo(Symbol(), MODE_STOPLEVEL);`
90

Ali Sabbaghi:

You have to get it from market info...

I want to get min take profit.

But thank you Ali Sabbaghi :)

Moderator
20526

Par duck:

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.

90

Keith Watford:

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!