How to change Risk in percent to Lot size or fix lot in EA breakdown Experts: breakdown.

 
Hello Traders... Please Help 

How to change Risk in percent to Lot size or fix lot in EA breakdown Experts: breakdown. 






//+------------------------------------------------------------------+

//|                           breakdown(barabashkakvn's edition).mq5 |
//|                                                           Arist0 |
//|                                              arist0.rr@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Arist0"
#property link      "arist0.rr@gmail.com"
#property version   "1.001"
//---
#include <Trade\PositionInfo.mqh>
#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>  
#include <Trade\AccountInfo.mqh>
#include <Trade\OrderInfo.mqh>
#include <Expert\Money\MoneyFixedMargin.mqh>
CPositionInfo  m_position;                   // trade position object
CTrade         m_trade;                      // trading object
CSymbolInfo    m_symbol;                     // symbol info object
CAccountInfo   m_account;                    // account info wrapper
COrderInfo     m_order;                      // pending orders object
CMoneyFixedMargin *m_money;
//--- input parameters
input ushort   InpStopLoss       = 50;       // Stop Loss (in pips)
input ushort   InpTakeProfit     = 50;       // Take Profit (in pips)
input ushort   InpTrailingStop   = 5;        // Trailing Stop (in pips)
input ushort   InpTrailingStep   = 5;        // Trailing Step (in pips)
input ushort   InpMinDistance    = 25;       // Minimum distance
input double   Risk              = 5;        // Risk in percent for a deal from a free margin   ????

input ulong    m_magic           = 585000550;// magic number
//---
ulong          m_slippage=10;                // slippage

double         ExtStopLoss=0.0;
double         ExtTakeProfit=0.0;
double         ExtTrailingStop=0.0;
double         ExtTrailingStep=0.0;
double         ExtMinDistance=0.0;

double         m_adjusted_point;             // point value adjusted for 3 or 5 points

bool           bln_delete_all=false;
datetime       dt_last_delete=0;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
i
Documentation on MQL5: Standard Library / Strategy Modules / Money Management Classes / CMoneyFixedMargin
Documentation on MQL5: Standard Library / Strategy Modules / Money Management Classes / CMoneyFixedMargin
  • www.mql5.com
CMoneyFixedMargin - Money Management Classes - Strategy Modules - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
          General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
          Messages Editor

 
William Roeder #:

Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
          General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
          Messages Editor

hello sirr..
I have edited sir..
please enlighten and help, to change the risk settings to manual lots.
Thank you for the help.