Indicators: Money Manager Graphic Tool - page 9

 
William Roeder #:

Reduce the resolution of your screen. Very little code adjusts for high res and I haven't researched it yet.

Yes. You can't modify the one OrderSend or have it done?


Updated version adds the following:

  1. One Cancels Other (OCO.) Two opposite pending orders, when first filled, other is deleted, (if enabled.)
  2. Generalization of PIP for metals and exotics.
  3. Trades are shown like the tester does, or when closed orders are dragged onto the chart (if enabled.)
Thank you, Sir. This tool is exactly what I was looking for.
 
pcfxalerts #:

Hey guys I started working on converting some of the code to MT5 because I needed it to work in MT5 for my own use. I have attached the code below.


Update: Added changes to most recent MT4 version of the code, file "order_graphic_tool_v5_5basic_visual_mod_for_1920x10802"

//| 15-Feb-2021 Updated by pcfxalerts (pcfxalerts@gmail.com)

//|   - Added external input to set the account balance to something other than the balance you have with the broker.

//|   - added separators to inputs

//|   - added input to turn on / off sounds

//|   - added input "Default Stop Loss Pips"

//|   - added inputs to change box height/width  
Excellent! Much better now.
 

Hi all,

Thanks for making this Money Management Graphic Tool available. I'm trying to add a leverage limiting feature to it.

Using the variables from the order_graphic_tool_v5_5basic_visual_mod_for_1920x10802 plus some new variables I added, below is my initial attempt to calculate the real leverage of a new trade as the variable NewTradeRealLeverage and then compare that NewTradeRealLeverage to the MaximumPerTradeLeverage and limit the new trade leverage to the MaximumPerTradeLeverage.

I'm no expert like Willam Roeder and others in this thread, so if anyone of you can figure out how to integrate this idea properly into the order_graphic_tool, I will really appreciate if you would share it with us. Thanks.

enum Money{ Balance, Equity };
extern double  ogt_AccountBalance      = 0;       // Use amount ($) different than account balance
extern double  InitialPercent          = 1.0;     // Percentage Initial Risk
extern bool    RiskBasis               = Balance; // Risk basis
extern double  MaximumPerTradeLeverage = 10;      // Maximum Per Trade Leverage

double   dVpL    = tickValue / tickSize; // DeltaValuePerlot
string   USD      = AccountInfoString(ACCOUNT_CURRENCY);
string   balance = RiskBasis == Balance  ? "Balance" : "Equity";
double   money   = ogt_AccountBalance == 0 ? AccountInfoDouble(RiskBasis == Balance ? ACCOUNT_BALANCE : ACCOUNT_EQUITY):ogt_AccountBalance;
double   risk    = money * InitialPercent / 100.0; // Risk in the ACCOUNT_CURRENCY
double   maxLots = normalize_lots( risk / (sl * dVpL + CommissionPerLot) );  // div 0

double   lotsize = 0; // MarketInfo(Symbol(), MODE_LOTSIZE);
double   BaseDEP = 0; // Rate of the Base Currency in terms of the ACCOUNT_CURRENCY
double   NewPositionSize = 0; // NewPositionSize in the ACCOUNT_CURRENCY
double   NewTradeRealLeverage = 0;

   while(true)
   {
     lotsize = MarketInfo(Symbol(), MODE_LOTSIZE);
     BaseDEP = iClose(Symbol(),0,0)*dVpL/lotsize; // Rate of the Base Currency in terms of the ACCOUNT_CURRENCY
     NewPositionSize = maxLots*lotsize*BaseDEP;   // NewPositionSize in the ACCOUNT_CURRENCY
     NewTradeRealLeverage = NewPositionSize/(money-risk);

     // Keep the new trade real leverage at or below the MaximumPerTradeLeverage
     if(MaximumPerTradeLeverage>0 && NewTradeRealLeverage>MaximumPerTradeLeverage)
      {
        maxLots*=0.99;   // Must still round to lotStep.
        continue;
      }

      break;
   } // while (true)
 

Hi, 

There is an option in the input 

Risk basis - true or false

If it is set to FALSE - it will be based on Balance or Equity?

Thank you for EA

 
Hipcio_Puff #: There is an option in the input Risk basis - true or false. If it is set to FALSE - it will be based on Balance or Equity?

It is actually a bug. It should have been an enumeration and not a boolean ...

enum Money{ Balance, Equity };
extern Money RiskBasis = Balance; //Risk basis

However, as a boolean, false is Balance and true is Equity.

 
thank you for sharing your work, please this EA is not working is there any help to make it work?
Reason: