Download MetaTrader 5

MODE_STOPLEVEL returns 0

To add comments, please log in or register
MisterDog
383
MisterDog  

Shouldn't this line of code returned something other than zero?

Print("Stop level in points=",MarketInfo(Symbol(),MODE_STOPLEVEL));

For me it simply returning "0" rather than the minimum stop level. I thought perhaps the stop level really was 0, (OANDA is my broker) so I tried setting my stop very close to the current price but trade would not be accepted. Presumably this is because I violated the minimum stop level. Thoughts?

qjol
3243
qjol  

MisterDog:

Thoughts?


Bug
James Hodges
4240
James Hodges  

You may get a different result on a different server.. it may not be a metatrader thing .. it may be a broker's server thing. Give it a try and see...

I'll try it on a few servers too...

Update:

ok i tried it on a live ibfx and also got 0.0

however on fxdd demo i got 10.0....

MisterDog
383
MisterDog  
qjol:

Bug


This works

double minStopVal = MarketInfo(Symbol(),MODE_STOPLEVEL);

Print("Stop level in points=",minStopVal);
if (minStopVal == 0)
{
   Print("bug");
   OpenChatWindow(OANDA);
   ChatType("What is the minimum stop value?");
   extern double minStopVal = 0.0005; // enter minimum stop value here
}


   
Alarska
26
Alarska  

For anyone who wonders about OANDA's stop levels: they are simply none. You can put the stop as close to the current price as you want, so 0.1 pips. Figured that out after some research, hope it's helpful for someone else.

To add comments, please log in or register