problem with buy order.

joeflextronic
163
joeflextronic  

i wanted to execute a buy but cannot with the code below. my broker need 25 pips from market price, but i already set to 25 and still cannot, why? please help.

=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);

zzuegg
1503
zzuegg  

Ask-25*Point is not 25Pips avay from market price.

use Bid-25*Point..

but generally you should use

Bid-(MarketInfo(Symbol(),MODE_MIN_STOPLEVEL)*Point)
joeflextronic
163
joeflextronic  
zzuegg:

Ask-25*Point is not 25Pips avay from market price.

use Bid-25*Point..

but generally you should use


if for sell mode?

is it....... Ask-(MarketInfo(Symbol(),MODE_MIN_STOPLEVEL)*Point)

joeflextronic
163
joeflextronic  
zzuegg:

Ask-25*Point is not 25Pips avay from market price.

use Bid-25*Point..

but generally you should use


the MODE_MIN_STOPLEVEL is what?

zzuegg
1503
zzuegg  
joelloh:


the MODE_MIN_STOPLEVEL is what?

https://docs.mql4.com/constants/marketinfo

it's MODE_STOPLEVEL instead of MODE_MIN_STOPLEVEL

zzuegg
1503
zzuegg  

for stoploss and sell it should be

Ask + (MarketInfo(Symbol(),MODE_STOPLEVEL)*Point)