CMoneyFixedRisk::CheckOpenShort returning 0.0

 

I'm trying to calculate lotsize based on risk percentage, but CheckOpenShort is returning 0.0. Also, is there a way to have it return two decimals? 

Here's an example of what I'm trying to do: 

#include <Expert\Money\MoneyFixedRisk.mqh>
MqlTradeRequest request;
request.price = 1.00000;
request.sl = 1.00500;
CMoneyFixedRisk fixedRisk;
request.volume = fixedRisk.CheckOpenShort(request.price,request.sl); //request.volume == 0.0
 
KiteGX :

I'm trying to calculate lotsize based on risk percentage, but CheckOpenShort is returning 0.0. Also, is there a way to have it return two decimals? 

Here's an example of what I'm trying to do: 

Compare two examples: Money Fixed Risk and Money Fixed Margin . Note the result if you specify SL = 0.0.

Money Fixed Risk
Money Fixed Risk
  • www.mql5.com
An example for calculating the lot value in accordance with the risk per trade. Update: 28 Dec 2016 -> version 1.001 added two methods for outputting (printing) the calculated lot. Method 1 — when setting StopLoss to zero.              sl=;       check_open_long_lot=m_money.CheckOpenLong(m_symbol.(),sl);       ...
Reason: